-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(e2e): rhidp-4049 change app-config at e2e test runtime (#1850)
* RHIDP-4049 change app-config at e2e test runtime * Refactor namespace in config-map test Changed the namespace from "showcase" to "showcase-runtime" in the configuration test to align with the new environment setup. This ensures the tests run against the correct namespace. Signed-off-by: Gustavo Lira <[email protected]> * Add logging for ConfigMap updates and deployment restarts Enhanced the e2e test to include logging for key actions like updating ConfigMaps and restarting deployments. Modified the k8sHelper utility to log deployment status checks and errors for better traceability and debugging. Signed-off-by: Gustavo Lira <[email protected]> * Simplify logging and improve readability in deployment scripts Updated various sections to utilize `console.log` and `console.error` for better clarity and simplicity in logging outputs. Indentation was corrected to improve readability, and unnecessary log statements were removed to streamline the code. Signed-off-by: Gustavo Lira <[email protected]> * Improve deployment debugging with detailed logs Added detailed logging of deployment conditions and events to aid in debugging. This includes logging deployment status conditions and capturing events associated with the deployment during restarts. Signed-off-by: Gustavo Lira <[email protected]> * Increase deployment readiness timeout and enhance logging Extended the deployment readiness timeout to 5 minutes and added logging for pod conditions to provide detailed insights during deployment checks. Refined condition checks to include both 'Progressing' and 'Available' states for completeness. Signed-off-by: Gustavo Lira <[email protected]> * Refactor k8sHelper.ts for improved logging and stability Centralized the Kubernetes label selector and streamlined the logging of pod conditions by consolidating duplicate label selectors. Removed unnecessary deployment status checks for better performance and added error handling when retrieving pod conditions. Signed-off-by: Gustavo Lira <[email protected]> * Refactor deployment status check and logging Added inline comments to clarify deployment status checking and logging enhancements. Specifically, log pod conditions using a label selector and verify replica count for readiness. Signed-off-by: Gustavo Lira <[email protected]> * Add optional labelSelector to logPodConditions method Refactored the logPodConditions method to accept an optional labelSelector parameter. This allows more flexibility in logging pod conditions by using different label selectors if provided. Updated references within the method to use the new parameter accordingly. Signed-off-by: Gustavo Lira <[email protected]> * Reorganize runtime test deployment to periodic jobs Moved deployment and testing of `showcase-runtime` from regular job flow to periodic job flow. This change ensures that runtime configuration changes and TLS config tests are only performed during nightly jobs, improving efficiency in the regular CI pipeline. Signed-off-by: Gustavo Lira <[email protected]> --------- Signed-off-by: Gustavo Lira <[email protected]>
- Loading branch information
1 parent
1a4a1d5
commit 058a609
Showing
8 changed files
with
239 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
e2e-tests/playwright/e2e/configuration-test/config-map.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import { Common } from "../../utils/Common"; | ||
import { kubeCLient } from "../../utils/k8sHelper"; | ||
import { logger } from "../../utils/Logger"; | ||
|
||
test.describe("Change app-config at e2e test runtime", () => { | ||
test("Verify title change after ConfigMap modification", async ({ page }) => { | ||
test.setTimeout(300000); // Increasing to 5 minutes | ||
|
||
const configMapName = "app-config-rhdh"; | ||
const namespace = "showcase-runtime"; | ||
const deploymentName = "rhdh-backstage"; | ||
|
||
const kubeUtils = new kubeCLient(); | ||
const dynamicTitle = generateDynamicTitle(); | ||
|
||
try { | ||
logger.info(`Updating ConfigMap '${configMapName}' with new title.`); | ||
await kubeUtils.updateConfigMapTitle( | ||
configMapName, | ||
namespace, | ||
dynamicTitle, | ||
); | ||
|
||
logger.info( | ||
`Restarting deployment '${deploymentName}' to apply ConfigMap changes.`, | ||
); | ||
await kubeUtils.restartDeployment(deploymentName, namespace); | ||
|
||
const common = new Common(page); | ||
await common.loginAsGuest(); | ||
logger.info("Verifying new title in the UI..."); | ||
expect(await page.title()).toContain(dynamicTitle); | ||
logger.info("Title successfully verified in the UI."); | ||
} catch (error) { | ||
logger.error( | ||
`Test failed during ConfigMap update or deployment restart:`, | ||
error, | ||
); | ||
throw error; | ||
} | ||
}); | ||
}); | ||
|
||
function generateDynamicTitle() { | ||
const timestamp = new Date().toISOString().replace(/[-:.]/g, ""); | ||
return `New Title - ${timestamp}`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.