From 1a70085eb11f8c637dafbf15642bd6875144511c Mon Sep 17 00:00:00 2001 From: Laura Bergoens Date: Mon, 2 Dec 2024 00:33:44 +0100 Subject: [PATCH] fix(e2e): inserts learning content in database before running e2e --- .circleci/config.yml | 30 ++++++++++++++++++++++++++++++ high-level-tests/e2e/package.json | 6 +++--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fb7785929ab..71c6ca2f98a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -829,6 +829,21 @@ jobs: background: true command: npm start + - run: + name: Prepare database + working_directory: ~/pix/api + environment: + DATABASE_URL: 'postgres://circleci@localhost:5432/circleci' + command: npm run db:prepare + + - run: + name: Refresh cache + environment: + JOBS: 1 + DATABASE_URL: 'postgres://circleci@localhost:5432/circleci' + working_directory: ~/pix/api + command: npm run cache:refresh + - run: name: Run tests environment: @@ -900,6 +915,21 @@ jobs: background: true command: npm start + - run: + name: Prepare database + working_directory: ~/pix/api + environment: + DATABASE_URL: 'postgres://circleci@localhost:5432/circleci' + command: npm run db:prepare + + - run: + name: Refresh cache + environment: + JOBS: 1 + DATABASE_URL: 'postgres://circleci@localhost:5432/circleci' + working_directory: ~/pix/api + command: npm run cache:refresh + - run: name: Run tests environment: diff --git a/high-level-tests/e2e/package.json b/high-level-tests/e2e/package.json index 9ce04509f42..f119eedf374 100644 --- a/high-level-tests/e2e/package.json +++ b/high-level-tests/e2e/package.json @@ -31,8 +31,8 @@ "start:api": "cd ../../api && DATABASE_URL=postgresql://postgres@localhost/pix_test npm run start:watch", "start:mon-pix": "cd ../../mon-pix && npm start", "start:orga": "cd ../../orga && npm start", - "test:ci:app": "npm run db:initialize && npx wait-on http://localhost:3000/api http://localhost:4200 && npm run cy:run:ci:app", - "test:ci:orga": "npm run db:initialize && npx wait-on http://localhost:3000/api http://localhost:4201 && npm run cy:run:ci:orga" + "test:ci:app": "npx wait-on http://localhost:3000/api http://localhost:4200 && npm run cy:run:ci:app", + "test:ci:orga": "npx wait-on http://localhost:3000/api http://localhost:4201 && npm run cy:run:ci:orga" }, "devDependencies": { "@badeball/cypress-cucumber-preprocessor": "^20.0.0", @@ -49,4 +49,4 @@ "dependencies": { "jsonwebtoken": "8.5.1" } -} +} \ No newline at end of file