Skip to content

feat(e2e): share orchestrator installation script#60

Open
AndrienkoAleksandr wants to merge 2 commits intoredhat-developer:mainfrom
AndrienkoAleksandr:share-orchestrator-installation-script
Open

feat(e2e): share orchestrator installation script#60
AndrienkoAleksandr wants to merge 2 commits intoredhat-developer:mainfrom
AndrienkoAleksandr:share-orchestrator-installation-script

Conversation

@AndrienkoAleksandr
Copy link

Our e2e tests should cover Orchestrator feature for two plugins: orchestrator and bulk-import. It would be nice to have a common script place to use this script in the overlay repository. Also this pr is reaction on comment redhat-developer/rhdh-plugin-export-overlays#1972 (comment)

AndrienkoAleksandr and others added 2 commits March 17, 2026 02:23
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Co-authored-by: Yona First <yfirst@redhat.com>
Co-authored-by: Gustavo Lira e Silva <guga.java@gmail.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Copy link
Member

@subhashkhileri subhashkhileri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script is added to the files array so it ships with the npm package, but there's no clean way for consumers to invoke it. They'd have to reference it via a fragile node_modules
path:

await $bash node_modules/@red-hat-developer-hub/e2e-test-utils/scripts/install-orchestrator.sh ${namespace};

This is brittle (breaks with different package manager hoisting strategies like yarn PnP, pnpm) and inconsistent with the rest of the package where everything is exported as
TypeScript.

Suggestion: Add a TypeScript wrapper that uses zx's $ and export it. Following the existing pattern of keycloak/ and rhdh/ under src/deployment/, orchestrator should be its own
deployment module with the script co-located:

src/deployment/orchestrator/
├── index.ts # exports installOrchestrator()
└── install-orchestrator.sh # the script (moved from scripts/)

// src/deployment/orchestrator/index.ts
import { resolve } from "path";
import { $ } from "../../utils/index.js";

const scriptPath = resolve(import.meta.dirname, "install-orchestrator.sh");

export async function installOrchestrator(namespace = "orchestrator") {
await $bash ${scriptPath} ${namespace};
}

The .sh file needs to be copied to dist/ during build, following the existing pattern used by rhdh/config and keycloak/config:

"build": "yarn clean && tsc -p tsconfig.build.json && cp -r src/deployment/rhdh/config dist/deployment/rhdh/ && cp -r src/deployment/keycloak/config dist/deployment/keycloak/ && cp
src/deployment/orchestrator/install-orchestrator.sh dist/deployment/orchestrator/"

With a new export in package.json:

"./orchestrator": {
"types": "./dist/deployment/orchestrator/index.d.ts",
"default": "./dist/deployment/orchestrator/index.js"
}

This way the "scripts" entry in the files array can be dropped — the script ships inside dist/ which is already included.

Consumer usage would then be clean and consistent:

import { installOrchestrator } from "@red-hat-developer-hub/e2e-test-utils/orchestrator";

test.beforeAll(async () => {
await installOrchestrator("my-namespace");
});

also please fix the failing pr checks on this pr. and I hope we are also testing these changes locally for your new PR on overlay because we don't have a any job/pr check that validates this.

fi
fi

local pqsl_secret_name pqsl_svc_name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like a type Typo: pqsl → psql


set -e

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems Unused

log::success "Orchestrator deployment completed successfully!"
}

main "$@" No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
main "$@"
main "$@"

Fix newline at EOF

configure_namespace() {
local project=$1
log::warn "Recreating namespace: $project"
delete_namespace "$project"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package have k8s api's to perform deltion and creation, also the fixture creates the namespace, if we delete it might interfere with it. so i would say let the consumer (test) control it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants