Skip to content

Commit

Permalink
Fix CI-nightly tests and refactoring cypress config (#7908)
Browse files Browse the repository at this point in the history
  • Loading branch information
novda authored May 17, 2024
1 parent f7b47fe commit 59e31b3
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 48 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,13 @@ jobs:
name: cypress_screenshots
path: ${{ github.workspace }}/tests/cypress/screenshots

- name: Uploading cypress videos as an artifact
if: failure()
uses: actions/upload-artifact@v3.1.1
with:
name: cypress_videos_${{ matrix.specs }}
path: ${{ github.workspace }}/tests/cypress/videos

- name: Uploading "cvat" container logs as an artifact
if: failure()
uses: actions/upload-artifact@v3.1.1
Expand Down
24 changes: 24 additions & 0 deletions tests/cypress.base.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright (C) 2024 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
const plugins = require('./cypress/plugins/index');

module.exports = {
video: true,
viewportWidth: 1300,
viewportHeight: 960,
defaultCommandTimeout: 25000,
downloadsFolder: 'cypress/fixtures',
env: {
user: 'admin',
email: 'admin@localhost.company',
password: '12qwaszx',
},
e2e: {
setupNodeEvents(on, config) {
return plugins(on, config);
},
testIsolation: false,
baseUrl: 'http://localhost:8080',
},
};
19 changes: 3 additions & 16 deletions tests/cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@
const { defineConfig } = require('cypress');
const plugins = require('./cypress/plugins/index');
const baseConfig = require('./cypress.base.config');

module.exports = defineConfig({
video: true,
viewportWidth: 1300,
viewportHeight: 960,
defaultCommandTimeout: 25000,
...baseConfig,
numTestsKeptInMemory: 30, // reduce because out of memory issues
downloadsFolder: 'cypress/fixtures',
env: {
user: 'admin',
email: 'admin@localhost.company',
password: '12qwaszx',
},
e2e: {
setupNodeEvents(on, config) {
return plugins(on, config);
},
testIsolation: false,
baseUrl: 'http://localhost:8080',
...baseConfig.e2e,
specPattern: [
'cypress/e2e/auth_page.js',
'cypress/e2e/features/*.js',
Expand Down
19 changes: 3 additions & 16 deletions tests/cypress_canvas3d.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
const { defineConfig } = require('cypress');
const plugins = require('./cypress/plugins/index');
const baseConfig = require('./cypress.base.config');

module.exports = defineConfig({
video: false,
viewportWidth: 1300,
viewportHeight: 960,
defaultCommandTimeout: 25000,
downloadsFolder: 'cypress/fixtures',
env: {
user: 'admin',
email: 'admin@localhost.company',
password: '12qwaszx',
},
...baseConfig,
e2e: {
setupNodeEvents(on, config) {
return plugins(on, config);
},
testIsolation: false,
baseUrl: 'http://localhost:8080',
...baseConfig.e2e,
specPattern: [
'cypress/e2e/auth_page.js',
'cypress/e2e/canvas3d_functionality/*.js',
Expand Down
19 changes: 3 additions & 16 deletions tests/nightly_cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
const { defineConfig } = require('cypress');
const plugins = require('./cypress/plugins/index');
const baseConfig = require('./cypress.base.config');

module.exports = defineConfig({
video: false,
viewportWidth: 1300,
viewportHeight: 960,
defaultCommandTimeout: 25000,
downloadsFolder: 'cypress/fixtures',
env: {
user: 'admin',
email: 'admin@localhost.company',
password: '12qwaszx',
},
...baseConfig,
e2e: {
setupNodeEvents(on, config) {
return plugins(on, config);
},
testIsolation: false,
baseUrl: 'http://localhost:8080',
...baseConfig.e2e,
specPattern: [
'cypress/e2e/auth_page.js',
'cypress/e2e/features/*.js',
Expand Down

0 comments on commit 59e31b3

Please sign in to comment.