feat: Introduce force re-deploy option#87
feat: Introduce force re-deploy option#87AndrienkoAleksandr wants to merge 4 commits intoredhat-developer:mainfrom
Conversation
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
|
@subhashkhileri, what do you think about this pull request? |
|
@subhash Khileri, I hope you’re doing well. I’d really appreciate your thoughts on this PR: Along with that, I wanted to share some use cases I encountered while working on e2e tests. I’ve recently worked on two e2e-related pull requests:
In both cases, I had separate test.describe sections that required RHDH to be deployed with different application or plugin configurations. Currently,
Given these limitations, do you think the approach proposed in this PR makes sense? Or would you recommend continuing with the existing methods? Thanks in advance for your feedback! |
|
Hey! Thanks for working on this — the bulk-import e2e tests look great. I have some thoughts on the Only one describe block needs Looking at the consumer PR (#1972), only the orchestrator mode describe uses Suggested approach: split into two spec files The orchestrator mode tests are fully independent — they create their own test data (scoped by // playwright.config.ts
export default defineConfig({
projects: [
{ name: "bulk-import", testMatch: "bulk-import.spec.ts" },
{ name: "bulk-import-orchestrator", testMatch: "bulk-import-orchestrator.spec.ts" },
],
});
They run in parallel, each with full If they must stay in one file — existing APIs already work If there's a reason to keep everything in one spec file, the existing public API already supports updating RHDH config mid-test. Just make sure to wrap it in await test.runOnce("bulk-import-orchestrator-config", async () => {
await rhdh.k8sClient.applyConfigMapFromObject(
"app-config-rhdh",
newAppConfig,
rhdh.deploymentConfig.namespace,
);
await rhdh.scaleDownAndRestart();
await rhdh.waitUntilReady();
});This makes the intent clear to anyone reading the test — the existing deployment is being updated and restarted with a new configuration, rather than a full redeploy happening behind the scenes. And wrapping it in Why I'm cautious about The reason With What do you think? |
|
Hello, thanks for the suggestions! I initially tried the following approach, and it works: However, this requires maintaining a full copy of the app-config-rhdh ConfigMap with test-specific modifications. I would also need to keep this copy in sync in case something changes in future RHDH releases or in the e2e test framework’s deployment logic. Additionally, this ConfigMap would duplicate configuration already present in other tests/config files. Alternatively, I could implement a patch/merge strategy for this configuration (for example: https://github.com/redhat-developer/rhdh-plugin-export-overlays/pull/2066/changes#diff-10779869d96a728a6ddfa11481c33c55ff1a4d1ad211b612b73b89e45174f4bbR29 So ideally, it would be great to reuse that instead of reimplementing similar logic in tests.
I can take a look at this approach. However, I noticed in another PR that using a single file was previously recommended: So I assume that using multiple files may also have some limitations or trade-offs. For example, I’m not sure how test suites from multiple files are expected to run in parallel. In my case, for the bulk-import plugin, I need to test two different modes (open pull request and orchestrator). To run them in parallel, the framework would likely need to deploy two separate RHDH instances. Additionally, I have an open issue to implement a third mode (scaffolder template execution). Would that mean having three separate spec files? Given the current limitations, it seems that parallel execution may not be feasible unless the framework supports multiple independent RHDH deployments. So in my case, I would likely need to use multiple spec files and run them sequentially... P.S. Sorry for the long message — I’m trying to understand the recommended best practices for more complex test scenarios. It’s possible I’m overthinking this since we’ve just started using the framework. |
@subhashkhileri, few files really works in parallel, thank you very much! |
What does this pull request do:
Introduce force re-deploy option. This PR introduces a way to redeploy RHDH with modified configuration without full teardown, while reusing existing merge logic.