|
|
@@ -2,11 +2,11 @@ import { checkErrors } from '../support';
|
|
|
|
|
|
const PLUGIN_TEMPLATE_NAME = 'console-plugin-template';
|
|
|
const PLUGIN_TEMPLATE_PULL_SPEC = Cypress.env('PLUGIN_TEMPLATE_PULL_SPEC');
|
|
|
-// We know that the baseUrl is always set because it's in the cypress config
|
|
|
-// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
|
+
|
|
|
export const isLocalDevEnvironment = Cypress.config('baseUrl')!.includes('localhost');
|
|
|
|
|
|
const installHelmChart = (path: string) => {
|
|
|
+ // Install the plugin in a dedicated namespace using the helm chart from this repo
|
|
|
cy.exec(
|
|
|
`cd ../../console-plugin-template && ${path} upgrade -i ${PLUGIN_TEMPLATE_NAME} charts/openshift-console-plugin -n ${PLUGIN_TEMPLATE_NAME} --create-namespace --set plugin.image=${PLUGIN_TEMPLATE_PULL_SPEC}`,
|
|
|
{
|
|
|
@@ -15,9 +15,22 @@ const installHelmChart = (path: string) => {
|
|
|
).then((result) => {
|
|
|
result.stderr && cy.log('Error installing helm chart: ', result.stderr);
|
|
|
result.stdout && cy.log('Successfully installed helm chart: ', result.stdout);
|
|
|
- cy.visit('/k8s/cluster/operator.openshift.io~v1~Console/cluster/console-plugins');
|
|
|
- cy.get('[data-test="console-plugin-template-status"]').should('include.text', 'loaded');
|
|
|
});
|
|
|
+
|
|
|
+ // Wait for the plugin deployment to be ready
|
|
|
+ cy.exec(
|
|
|
+ `oc rollout status -n ${PLUGIN_TEMPLATE_NAME} deploy/${PLUGIN_TEMPLATE_NAME} -w --timeout=300s`,
|
|
|
+ { timeout: 360000, failOnNonZeroExit: false },
|
|
|
+ );
|
|
|
+
|
|
|
+ // Wait for console pods to restart with the new plugin
|
|
|
+ cy.exec('oc rollout status -w deploy/console -n openshift-console --timeout=300s', {
|
|
|
+ timeout: 360000,
|
|
|
+ failOnNonZeroExit: false,
|
|
|
+ });
|
|
|
+
|
|
|
+ cy.visit('/k8s/cluster/operator.openshift.io~v1~Console/cluster/console-plugins');
|
|
|
+ cy.get(`[data-test="${PLUGIN_TEMPLATE_NAME}-status"]`).should('include.text', 'Loaded');
|
|
|
};
|
|
|
const deleteHelmChart = (path: string) => {
|
|
|
cy.exec(
|
|
|
@@ -36,7 +49,7 @@ describe('Console plugin template test', () => {
|
|
|
cy.login();
|
|
|
cy.get(`[data-test="tour-step-footer-secondary"]`).contains('Skip tour').click();
|
|
|
if (!isLocalDevEnvironment) {
|
|
|
- console.log('this is not a local env, installig helm');
|
|
|
+ console.log('this is not a local env, installing helm');
|
|
|
|
|
|
cy.exec('cd ../../console-plugin-template && ./install_helm.sh', {
|
|
|
failOnNonZeroExit: false,
|