From 6341a5d2f937ce75b58918d6f2755d77f8ce84f0 Mon Sep 17 00:00:00 2001 From: Andrew Breidenbach Date: Wed, 19 Jun 2024 17:31:37 +0200 Subject: [PATCH] standalone: fix regressions for e2e test and standard deploy flow --- cypress.config.mjs | 2 +- cypress/support/run-recreate-deployment.js | 2 +- jsconfig.json | 24 ++++++++++ packages/oc-pages/.eslintrc.js | 2 +- .../components/dashboard-deploy-dialog.vue | 33 +++++++++++-- packages/oc-pages/dashboard/pages/home.vue | 6 +-- .../store/modules/environments.js | 2 +- .../components/oc/base-deploy-dialog.vue | 48 ++++++++++++++----- .../vue_shared/components/oc/ufgui-errors.vue | 4 +- scripts/src/integration-test.js | 13 +++-- 10 files changed, 108 insertions(+), 28 deletions(-) create mode 100644 jsconfig.json diff --git a/cypress.config.mjs b/cypress.config.mjs index e46cf438..123aa134 100644 --- a/cypress.config.mjs +++ b/cypress.config.mjs @@ -7,7 +7,7 @@ export default defineConfig({ defaultCommandTimeout, videoCompression: false, video: false, - numTestsKeptInMemory: 0, + numTestsKeptInMemory: 1, watchForFileChanges: false, // enable for Cypress 12.x // experimentalMemoryManagement: true, diff --git a/cypress/support/run-recreate-deployment.js b/cypress/support/run-recreate-deployment.js index 3f567cd3..1fb1f4c7 100644 --- a/cypress/support/run-recreate-deployment.js +++ b/cypress/support/run-recreate-deployment.js @@ -331,7 +331,6 @@ Cypress.Commands.add('recreateDeployment', options => { cy.wait(BASE_TIMEOUT / 50) if(shouldDeploy) { - cy.whenUnfurlGUI(() => { cy.get('[data-testid="deploy-button"]:not([disabled])').click({force: true}) cy.url({timeout: BASE_TIMEOUT * 10}).should('not.include', 'deployment-drafts') @@ -368,6 +367,7 @@ Cypress.Commands.add('recreateDeployment', options => { // cy.get('[data-testid="deploy-button"]:not([disabled])').click({position: 'bottomLeft'}) // doesn't work reliably in CI // popover tooltip may partially cover when deplying DRYRUN + cy.get('[data-testid="deploy-button"]:not([disabled])').click({force: true}) cy.url({timeout: BASE_TIMEOUT * 10}).should('include', dt.name) cy.wait(BASE_TIMEOUT) cy.withJob((job) => { diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 00000000..5587153a --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "target": "es6", // Specify ECMAScript target version: 'es5', 'es6', 'es2016', 'es2017', 'es2018', 'esnext', etc. + "module": "commonjs", // Specify module code generation: 'commonjs', 'amd', 'system', 'umd', 'es6', 'es2015', 'none' + "checkJs": false, // Enable/disable type checking in JavaScript files + "jsx": "preserve", // Specify JSX code generation: 'preserve', 'react-native', or 'react' + "baseUrl": ".", // Base directory to resolve non-relative module names + "paths": { + "oc/*": ["src/assets/javascripts/*"], + "oc_dashboard": ["src/gitlab-oc/dashboard"], + "oc_dashboard/*": ["src/gitlab-oc/dashboard/*"], + "oc_vue_shared/*": ["src/gitlab-oc/vue_shared/*"], + "~/*": ["src/assets/javascripts/*"], + "oc_pages/*": ["src/gitlab-oc/*"] + } + }, + "include": [ + "src/**/*" // Include all files in the 'src' folder and subfolders + ], + "exclude": [ + "node_modules", // Exclude 'node_modules' folder + "dist" // Exclude 'dist' folder + ] +} diff --git a/packages/oc-pages/.eslintrc.js b/packages/oc-pages/.eslintrc.js index 437e00ef..6382b8ce 100644 --- a/packages/oc-pages/.eslintrc.js +++ b/packages/oc-pages/.eslintrc.js @@ -20,7 +20,7 @@ module.exports = { ecmaVersion: 2020 }, rules: { - semi: [1], + semi: 'off', // XXX [1] "no-console": process.env.NODE_ENV === "production" ? "warn" : "off", "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", /* diff --git a/packages/oc-pages/dashboard/components/dashboard-deploy-dialog.vue b/packages/oc-pages/dashboard/components/dashboard-deploy-dialog.vue index adf883d3..a9d17a42 100644 --- a/packages/oc-pages/dashboard/components/dashboard-deploy-dialog.vue +++ b/packages/oc-pages/dashboard/components/dashboard-deploy-dialog.vue @@ -1,7 +1,7 @@ @@ -182,7 +206,7 @@ export default { :cloud-provider="templateSelected && templateSelected.cloud" />
- @@ -193,9 +217,9 @@ export default { :environment-creation="!standalone" />
- Use the current release of - {{ getApplicationBlueprint.title }} ({{ currentTag.name }}) - Use the latest (unreleased) version + Use the current release of + {{ applicationBlueprint.title }} ({{ currentTag.name }}) + Use the latest (unreleased) version
diff --git a/packages/oc-pages/vue_shared/components/oc/ufgui-errors.vue b/packages/oc-pages/vue_shared/components/oc/ufgui-errors.vue index d9099559..c890adce 100644 --- a/packages/oc-pages/vue_shared/components/oc/ufgui-errors.vue +++ b/packages/oc-pages/vue_shared/components/oc/ufgui-errors.vue @@ -88,7 +88,9 @@ export default { position: sticky; } -body.modal-open .ufgui-error-container { +/* Doesn't work consistently on dashboard page */ +body.modal-open #OcAppDeployments .ufgui-error-container { position: fixed; + min-width: min(950px, 100%) } diff --git a/scripts/src/integration-test.js b/scripts/src/integration-test.js index ccaf2728..dcf2a597 100755 --- a/scripts/src/integration-test.js +++ b/scripts/src/integration-test.js @@ -33,10 +33,11 @@ const GENERATED_PASSWORD = !STANDALONE_UNFURL && btoa(Number.MAX_SAFE_INTEGER * const FIXTURES_TMP = path.join(unfurlGuiRoot, 'cypress/fixtures/tmp') process.env.OC_URL = OC_URL -process.env.DASHBOARD_DEST = ( - process.env.DASHBOARD_DEST || - STANDALONE_UNFURL? STANDALONE_PROJECT_DIR: undefined -) + +if(STANDALONE_UNFURL && !process.env.DASHBOARD_DEST) { + process.env.DASHBOARD_DEST = STANDALONE_PROJECT_DIR +} + const READ_ARGS = { username: (args) => args.u || args.username || (STANDALONE_UNFURL && 'jest' || undefined), @@ -210,6 +211,10 @@ async function main() { username = undefined } + if(username && !process.env.DASHBOARD_DEST) { + process.env.DASHBOARD_DEST = `${username}/dashboard` + } + if(username) console.log(`${process.env.OC_URL}/${username}/dashboard/-/deployments`) const GCP_ENVIRONMENT_NAME = ENV_NAMING_FUNCTIONS[ENV_NAMING_FUNCTION]('gcp').toLowerCase()