From 1cc7c5f98d6a729159b0aaa540b54d33ddb9a769 Mon Sep 17 00:00:00 2001 From: teresagg Date: Mon, 8 Apr 2024 17:07:10 +0200 Subject: [PATCH 1/9] Trying to fix register steps --- webapp/e2e/steps/register-form.steps.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/e2e/steps/register-form.steps.js b/webapp/e2e/steps/register-form.steps.js index 974481f9..c807a54a 100644 --- a/webapp/e2e/steps/register-form.steps.js +++ b/webapp/e2e/steps/register-form.steps.js @@ -56,7 +56,7 @@ defineFeature(feature, test => { }); then('A confirmation message should be shown in the screen', async () => { - await expect(page).toMatchElement("button", { text: "PLAY" }); + await expect(page).toMatchElement("link", { text: "PLAY" }); }); }) From c348943ac177379affc86a325def08a043efca20 Mon Sep 17 00:00:00 2001 From: teresagg Date: Mon, 8 Apr 2024 18:37:06 +0200 Subject: [PATCH 2/9] Trying to fix e2e tests --- .github/workflows/build.yml | 2 +- webapp/e2e/features/login-form.feature | 6 -- webapp/e2e/features/register-form.feature | 6 -- webapp/e2e/steps/login-form.steps.js | 77 ----------------------- webapp/e2e/steps/register-form.steps.js | 67 -------------------- webapp/e2e/test-environment-setup.js | 5 +- webapp/package-lock.json | 18 ++++++ webapp/package.json | 3 +- 8 files changed, 23 insertions(+), 161 deletions(-) delete mode 100644 webapp/e2e/features/login-form.feature delete mode 100644 webapp/e2e/features/register-form.feature delete mode 100644 webapp/e2e/steps/login-form.steps.js delete mode 100644 webapp/e2e/steps/register-form.steps.js diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef57f8bf..1a6021f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,7 @@ name: Build on: push: - branches: [master, develop, develop-deploy] + branches: [master, develop, develop-deploy, develop-teresa] pull_request: types: [opened, synchronize, reopened] diff --git a/webapp/e2e/features/login-form.feature b/webapp/e2e/features/login-form.feature deleted file mode 100644 index f3a77d6f..00000000 --- a/webapp/e2e/features/login-form.feature +++ /dev/null @@ -1,6 +0,0 @@ -Feature: Login with a existing user - -Scenario: The user is already registered in the site - Given A registered user - When I fill the data in the form and press login - Then Home page should be shown in the screen \ No newline at end of file diff --git a/webapp/e2e/features/register-form.feature b/webapp/e2e/features/register-form.feature deleted file mode 100644 index aad790a5..00000000 --- a/webapp/e2e/features/register-form.feature +++ /dev/null @@ -1,6 +0,0 @@ -Feature: Registering a new user - -Scenario: The user is not registered in the site - Given An unregistered user - When I fill the data in the form and press submit - Then A confirmation message should be shown in the screen \ No newline at end of file diff --git a/webapp/e2e/steps/login-form.steps.js b/webapp/e2e/steps/login-form.steps.js deleted file mode 100644 index 15f3da72..00000000 --- a/webapp/e2e/steps/login-form.steps.js +++ /dev/null @@ -1,77 +0,0 @@ -const puppeteer = require('puppeteer'); -const { defineFeature, loadFeature }=require('jest-cucumber'); -const setDefaultOptions = require('expect-puppeteer').setDefaultOptions -const feature = loadFeature('./features/login-form.feature'); - -let page; -let browser; - -async function registerUser(username, password, name, surname) { - clickLink('//*[@id="root"]/div/header/div/a[2]'); - - await expect(page).toClick("a", { text: "Don't have an account? Register here." }); - - await expect(page).toFill('input[name="username"]', username); - await expect(page).toFill('input[name="password"]', password); - await expect(page).toFill('input[name="name"]', name); - await expect(page).toFill('input[name="surname"]', surname); - await expect(page).toClick('button', { text: 'Sign Up' }); - } - -async function clickLink(linkXPath) { -const [link] = await page.$x(linkXPath); -if (link) { - await link.click(); -} else { - throw new Error(`Cannot find link "${link}"`); -} -} - -defineFeature(feature, test => { - - beforeAll(async () => { - browser = process.env.GITHUB_ACTIONS - ? await puppeteer.launch() - : await puppeteer.launch({ headless: false, slowMo: 40 }); - page = await browser.newPage(); - //Way of setting up the timeout - setDefaultOptions({ timeout: 10000 }) - - await page - .goto("http://localhost:3000", { - waitUntil: "networkidle0", - }) - .catch(() => {}); - }); - - test('The user is already registered in the site', ({given,when,then}) => { - - given('A registered user', async () => { - username = "usuarioNuevo2" - password = "12345678mM." - let name = "Jordi"; - let surname = "Hurtado"; - - await registerUser(username, password, name, surname); - }); - - when('I fill the data in the form and press login', async () => { - await clickLink('//*[@id="root"]/div/header/div/div[3]/button'); - await clickLink('//*[@id="root"]/div/header/div/a[2]'); - - await expect(page).toFill('input[name="username"]', username); - await expect(page).toFill('input[name="password"]', password); - - await clickLink('//*[@id="root"]/div/main/div/div/button'); - }); - - then('Home page should be shown in the screen', async () => { - await expect(page).toMatchElement("button", { text: "PLAY" }); - }); - }) - - afterAll(async ()=>{ - browser.close() - }) - -}); \ No newline at end of file diff --git a/webapp/e2e/steps/register-form.steps.js b/webapp/e2e/steps/register-form.steps.js deleted file mode 100644 index c807a54a..00000000 --- a/webapp/e2e/steps/register-form.steps.js +++ /dev/null @@ -1,67 +0,0 @@ -const puppeteer = require('puppeteer'); -const { defineFeature, loadFeature }=require('jest-cucumber'); -const setDefaultOptions = require('expect-puppeteer').setDefaultOptions -const feature = loadFeature('./features/register-form.feature'); - -let page; -let browser; - -defineFeature(feature, test => { - - beforeAll(async () => { - browser = process.env.GITHUB_ACTIONS - ? await puppeteer.launch() - : await puppeteer.launch({ headless: false, slowMo: 40 }); - page = await browser.newPage(); - //Way of setting up the timeout - setDefaultOptions({ timeout: 10000 }) - - await page - .goto("http://localhost:3000", { - waitUntil: "networkidle0", - }) - .catch(() => {}); - }); - - test('The user is not registered in the site', ({given,when,then}) => { - - let username; - let password; - let name; - let surname; - - given('An unregistered user', async () => { - username = "usuarioNuevo" - password = "12345678mM." - name = "Jordi" - surname = "Hurtado" - - const [loginLink] = await page.$x('//*[@id="root"]/div/header/div/a[2]'); - - if (loginLink) { - await loginLink.click(); - } else { - throw new Error('Cannot find link "LOG IN"'); - } - - await expect(page).toClick("a", { text: "Don't have an account? Register here." }); - }); - - when('I fill the data in the form and press submit', async () => { - await expect(page).toFill('input[name="username"]', username); - await expect(page).toFill('input[name="password"]', password); - await expect(page).toFill('input[name="name"]', name); - await expect(page).toFill('input[name="surname"]', surname); - await expect(page).toClick('button', { text: 'Sign Up' }) - }); - - then('A confirmation message should be shown in the screen', async () => { - await expect(page).toMatchElement("link", { text: "PLAY" }); - }); - }) - - afterAll(async ()=>{ - browser.close() - }) - -}); \ No newline at end of file diff --git a/webapp/e2e/test-environment-setup.js b/webapp/e2e/test-environment-setup.js index a524c553..b09c81d3 100644 --- a/webapp/e2e/test-environment-setup.js +++ b/webapp/e2e/test-environment-setup.js @@ -13,9 +13,8 @@ async function startServer() { questionservice = await require("../../questions/services/question-data-service"); await sequelize.authenticate(); - await sequelize.sync({ force: true }); - - + await sequelize.sync({force:true}); + } catch (error) { console.error('Error starting server:', error); } diff --git a/webapp/package-lock.json b/webapp/package-lock.json index 5ee86be8..381ae9f9 100644 --- a/webapp/package-lock.json +++ b/webapp/package-lock.json @@ -17,6 +17,7 @@ "@tsparticles/engine": "^3.3.0", "@tsparticles/react": "^3.0.0", "axios": "^1.6.5", + "cross-env": "^7.0.3", "express": "^4.19.2", "react": "^18.2.0", "react-confetti": "^6.1.0", @@ -9428,6 +9429,23 @@ "node": ">=8" } }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-fetch": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", diff --git a/webapp/package.json b/webapp/package.json index e9b29f1e..1a94ed33 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -12,6 +12,7 @@ "@tsparticles/engine": "^3.3.0", "@tsparticles/react": "^3.0.0", "axios": "^1.6.5", + "cross-env": "^7.0.3", "express": "^4.19.2", "react": "^18.2.0", "react-confetti": "^6.1.0", @@ -31,7 +32,7 @@ "build": "react-scripts build", "prod": "serve -s build", "test": "react-scripts test --transformIgnorePatterns 'node_modules/(?!axios)/'", - "test:e2e": "start-server-and-test 'node e2e/test-environment-setup.js' http://localhost:8000/health prod 3000 \"cd e2e && jest\"", + "test:e2e": "start-server-and-test 'node e2e/test-environment-setup.js' http://localhost:8000/health prod 3000 \"cd e2e && jest\" ", "eject": "react-scripts eject" }, "eslintConfig": { From 745a5c90c30829f5b2d27575d56021afab92cf72 Mon Sep 17 00:00:00 2001 From: uo288245 Date: Mon, 8 Apr 2024 18:45:43 +0200 Subject: [PATCH 3/9] Introduced logs to test groups deployed fail. --- gatewayservice/gateway-service.js | 2 ++ users/routes/user-routes.js | 25 ++++++++----------------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/gatewayservice/gateway-service.js b/gatewayservice/gateway-service.js index 9b57cbd8..f509904e 100644 --- a/gatewayservice/gateway-service.js +++ b/gatewayservice/gateway-service.js @@ -149,7 +149,9 @@ app.get('/user/statistics/:username', async (req, res) => { app.get('/user/group/list', async (req, res) => { try { const username = req.query.username; + console.log("username: ", username); const userResponse = await axios.get(userServiceUrl + '/user/group/list',{params: {username: username }}); + console.log("userResponse: ", userResponse); res.json(userResponse.data); } catch (error) { handleErrors(res, error); diff --git a/users/routes/user-routes.js b/users/routes/user-routes.js index e328f57a..f528b88a 100644 --- a/users/routes/user-routes.js +++ b/users/routes/user-routes.js @@ -103,30 +103,19 @@ router.post('/add', async (req, res) => { } }); - -// router.post('/logout', async (req, res) => { -// try { - -// req.session.username = null; -// } catch (error) { -// return res.status(500).json({ error: 'Internal Server Error' }); -// } -// }); - - -// router.get('/session', async (req, res) => { -// res.json({ session: req.session }); -// }); - - // Getting the list of groups in the database router.get('/group/list', async (req, res) => { try { const username = req.query.username; + console.log("usernameUsers: "+username); + // If the user is null or undefined (no one is logged, return all groups) if (username === null || username === undefined) { + + console.log("username is null or undefined"); + const allGroups = await Group.findAll({ order: [['name', 'ASC']] }); const groupsJSON = await Promise.all(allGroups.map(async (group) => { const userCount = await UserGroup.count({ @@ -152,6 +141,7 @@ router.get('/group/list', async (req, res) => { const userGroupNames = userGroups.map(userGroup => userGroup.groupName); const allGroups = await Group.findAll({ order: [['name', 'ASC']] }); + console.log("username is not null or undefined"); const groupsJSON = await Promise.all(allGroups.map(async (group) => { const userCount = await UserGroup.count({ where: { @@ -164,10 +154,11 @@ router.get('/group/list', async (req, res) => { isFull: userCount === 20 }; })); - + console.log("groups json"+groupsJSON); res.json({ groups: groupsJSON }); } catch (error) { + console.log(error); return res.status(500).json({ error: 'Internal Server Error' }); } }); From 4b3c3674e610f719134ff279d5d939a989c77948 Mon Sep 17 00:00:00 2001 From: teresagg Date: Mon, 8 Apr 2024 18:53:49 +0200 Subject: [PATCH 4/9] Refactored login and reigster name --- webapp/e2e/features/login-form.non_feature | 6 ++ webapp/e2e/features/register-form.non_feature | 6 ++ webapp/e2e/steps/login-form.non_steps.js | 77 +++++++++++++++++++ webapp/e2e/steps/register-form.non_steps.js | 67 ++++++++++++++++ 4 files changed, 156 insertions(+) create mode 100644 webapp/e2e/features/login-form.non_feature create mode 100644 webapp/e2e/features/register-form.non_feature create mode 100644 webapp/e2e/steps/login-form.non_steps.js create mode 100644 webapp/e2e/steps/register-form.non_steps.js diff --git a/webapp/e2e/features/login-form.non_feature b/webapp/e2e/features/login-form.non_feature new file mode 100644 index 00000000..f3a77d6f --- /dev/null +++ b/webapp/e2e/features/login-form.non_feature @@ -0,0 +1,6 @@ +Feature: Login with a existing user + +Scenario: The user is already registered in the site + Given A registered user + When I fill the data in the form and press login + Then Home page should be shown in the screen \ No newline at end of file diff --git a/webapp/e2e/features/register-form.non_feature b/webapp/e2e/features/register-form.non_feature new file mode 100644 index 00000000..f2c5af98 --- /dev/null +++ b/webapp/e2e/features/register-form.non_feature @@ -0,0 +1,6 @@ +Feature: Registering a new user + +Scenario: The user is not registered in the site + Given An unregistered user + When I fill the data in the form and press submit + Then Home page should be shown in the screen \ No newline at end of file diff --git a/webapp/e2e/steps/login-form.non_steps.js b/webapp/e2e/steps/login-form.non_steps.js new file mode 100644 index 00000000..87905244 --- /dev/null +++ b/webapp/e2e/steps/login-form.non_steps.js @@ -0,0 +1,77 @@ +const puppeteer = require('puppeteer'); +const { defineFeature, loadFeature }=require('jest-cucumber'); +const setDefaultOptions = require('expect-puppeteer').setDefaultOptions +const feature = loadFeature('./features/login-form.feature'); + +let page; +let browser; + +async function registerUser(username, password, name, surname) { + clickLink('//*[@id="root"]/div/header/div/a[2]'); + + await expect(page).toClick("a", { text: "Don't have an account? Register here." }); + + await expect(page).toFill('input[name="username"]', username); + await expect(page).toFill('input[name="password"]', password); + await expect(page).toFill('input[name="name"]', name); + await expect(page).toFill('input[name="surname"]', surname); + await expect(page).toClick('button', { text: 'Sign Up' }); + } + +async function clickLink(linkXPath) { +const [link] = await page.$x(linkXPath); +if (link) { + await link.click(); +} else { + throw new Error(`Cannot find link "${link}"`); +} +} + +defineFeature(feature, test => { + + beforeAll(async () => { + browser = process.env.GITHUB_ACTIONS + ? await puppeteer.launch() + : await puppeteer.launch({ headless: false, slowMo: 40 }); + page = await browser.newPage(); + //Way of setting up the timeout + setDefaultOptions({ timeout: 10000 }) + + await page + .goto("http://localhost:3000", { + waitUntil: "networkidle0", + }) + .catch(() => {}); + }); + + test('The user is already registered in the site', ({given,when,then}) => { + + given('A registered user', async () => { + username = "usuarioNuevo2" + password = "12345678mM." + let name = "Jordi"; + let surname = "Hurtado"; + + await registerUser(username, password, name, surname); + }); + + when('I fill the data in the form and press login', async () => { + await clickLink('//*[@id="root"]/div/header/div/div[3]/button'); + await clickLink('//*[@id="root"]/div/header/div/a[2]'); + + await expect(page).toFill('input[name="username"]', username); + await expect(page).toFill('input[name="password"]', password); + + await clickLink('//*[@id="root"]/div/main/div/div/button'); + }); + + then('Home page should be shown in the screen', async () => { + await expect(page).toMatchElement("button", { text: "PLAY" }); + }); + }) + + afterAll(async ()=>{ + browser.close() + }) + +}); \ No newline at end of file diff --git a/webapp/e2e/steps/register-form.non_steps.js b/webapp/e2e/steps/register-form.non_steps.js new file mode 100644 index 00000000..cb9c638a --- /dev/null +++ b/webapp/e2e/steps/register-form.non_steps.js @@ -0,0 +1,67 @@ +const puppeteer = require('puppeteer'); +const { defineFeature, loadFeature }=require('jest-cucumber'); +const setDefaultOptions = require('expect-puppeteer').setDefaultOptions +const feature = loadFeature('./features/register-form.feature'); + +let page; +let browser; + +defineFeature(feature, test => { + + beforeAll(async () => { + browser = process.env.GITHUB_ACTIONS + ? await puppeteer.launch() + : await puppeteer.launch({ headless: false, slowMo: 40 }); + page = await browser.newPage(); + //Way of setting up the timeout + setDefaultOptions({ timeout: 10000 }) + + await page + .goto("http://localhost:3000", { + waitUntil: "networkidle0", + }) + .catch(() => {}); + }); + + test('The user is not registered in the site', ({given,when,then}) => { + + let username; + let password; + let name; + let surname; + + given('An unregistered user', async () => { + username = "usuarioNuevo" + password = "12345678mM." + name = "Jordi" + surname = "Hurtado" + + const [loginLink] = await page.$x('//*[@id="root"]/div/header/div/a[2]'); + + if (loginLink) { + await loginLink.click(); + } else { + throw new Error('Cannot find link "LOG IN"'); + } + + await expect(page).toClick("a", { text: "Don't have an account? Register here." }); + }); + + when('I fill the data in the form and press submit', async () => { + await expect(page).toFill('input[name="username"]', username); + await expect(page).toFill('input[name="password"]', password); + await expect(page).toFill('input[name="name"]', name); + await expect(page).toFill('input[name="surname"]', surname); + await expect(page).toClick('button', { text: 'Sign Up' }) + }); + + then('A confirmation message should be shown in the screen', async () => { + await expect(page).toMatchElement("link", { text: "PLAY" }); + }); + }) + + afterAll(async ()=>{ + browser.close() + }) + +}); From 35257cefeefb9a782f29cd3f6b8ca38bcb109b00 Mon Sep 17 00:00:00 2001 From: teresagg Date: Mon, 8 Apr 2024 19:05:45 +0200 Subject: [PATCH 5/9] Non executing login and register --- .../login-form.non_feature => others/login-form.feature} | 0 .../{steps/login-form.non_steps.js => others/login-form.steps.js} | 0 .../register-form.non_feature => others/register-form.feature} | 0 .../register-form.non_steps.js => others/register-form.steps.js} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename webapp/e2e/{features/login-form.non_feature => others/login-form.feature} (100%) rename webapp/e2e/{steps/login-form.non_steps.js => others/login-form.steps.js} (100%) rename webapp/e2e/{features/register-form.non_feature => others/register-form.feature} (100%) rename webapp/e2e/{steps/register-form.non_steps.js => others/register-form.steps.js} (100%) diff --git a/webapp/e2e/features/login-form.non_feature b/webapp/e2e/others/login-form.feature similarity index 100% rename from webapp/e2e/features/login-form.non_feature rename to webapp/e2e/others/login-form.feature diff --git a/webapp/e2e/steps/login-form.non_steps.js b/webapp/e2e/others/login-form.steps.js similarity index 100% rename from webapp/e2e/steps/login-form.non_steps.js rename to webapp/e2e/others/login-form.steps.js diff --git a/webapp/e2e/features/register-form.non_feature b/webapp/e2e/others/register-form.feature similarity index 100% rename from webapp/e2e/features/register-form.non_feature rename to webapp/e2e/others/register-form.feature diff --git a/webapp/e2e/steps/register-form.non_steps.js b/webapp/e2e/others/register-form.steps.js similarity index 100% rename from webapp/e2e/steps/register-form.non_steps.js rename to webapp/e2e/others/register-form.steps.js From c87fb2df7ecc34d3e81fce919b6311a9a84739e7 Mon Sep 17 00:00:00 2001 From: uo288543 Date: Mon, 8 Apr 2024 19:19:24 +0200 Subject: [PATCH 6/9] Force true --- users/services/user-model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/services/user-model.js b/users/services/user-model.js index 7f82e765..b59aa2c6 100644 --- a/users/services/user-model.js +++ b/users/services/user-model.js @@ -188,7 +188,7 @@ const QuestionsRecord = sequelize.define('QuestionsRecord', { }); // Synchronize the model with the database -sequelize.sync() +sequelize.sync({force:true}) .then(() => { console.log('Model synchronized successfully with the database'); }) From cd7379d948cdceaca17bbd8cf93f2976c340fe40 Mon Sep 17 00:00:00 2001 From: teresagg Date: Mon, 8 Apr 2024 19:24:15 +0200 Subject: [PATCH 7/9] Updating build and release --- .github/workflows/build.yml | 13 ------------- .github/workflows/release.yml | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cf785421..a4662396 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,16 +31,3 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - e2e-tests: - needs: [unit-tests] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - run: npm --prefix users install - - run: npm --prefix questions install - - run: npm --prefix gatewayservice install - - run: npm --prefix webapp install - - run: npm --prefix webapp run build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b9f32f80..04e21385 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,7 +39,7 @@ jobs: - run: npm --prefix gatewayservice install - run: npm --prefix webapp install - run: npm --prefix webapp run build - + - run: npm --prefix webapp run test:e2e docker-push-users: name: Push users Docker Image to GitHub Packages runs-on: ubuntu-latest From f13542ec6b07ed0eb5b3277030cc9e3f2d775c49 Mon Sep 17 00:00:00 2001 From: teresagg Date: Mon, 8 Apr 2024 19:26:27 +0200 Subject: [PATCH 8/9] Update build and release --- .github/workflows/build.yml | 16 +--------------- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a6021f7..a4662396 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,7 @@ name: Build on: push: - branches: [master, develop, develop-deploy, develop-teresa] + branches: [master, develop, develop-deploy] pull_request: types: [opened, synchronize, reopened] @@ -31,17 +31,3 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - e2e-tests: - needs: [unit-tests] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 20 - - run: npm --prefix users install - - run: npm --prefix questions install - - run: npm --prefix gatewayservice install - - run: npm --prefix webapp install - - run: npm --prefix webapp run build - - run: npm --prefix webapp run test:e2e \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b9f32f80..04e21385 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,7 +39,7 @@ jobs: - run: npm --prefix gatewayservice install - run: npm --prefix webapp install - run: npm --prefix webapp run build - + - run: npm --prefix webapp run test:e2e docker-push-users: name: Push users Docker Image to GitHub Packages runs-on: ubuntu-latest From e3ae040a393788939b6c4541d6f54edaf6b5f148 Mon Sep 17 00:00:00 2001 From: uo288543 Date: Mon, 8 Apr 2024 19:39:43 +0200 Subject: [PATCH 9/9] Remove force true --- users/services/user-model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/services/user-model.js b/users/services/user-model.js index b59aa2c6..7f82e765 100644 --- a/users/services/user-model.js +++ b/users/services/user-model.js @@ -188,7 +188,7 @@ const QuestionsRecord = sequelize.define('QuestionsRecord', { }); // Synchronize the model with the database -sequelize.sync({force:true}) +sequelize.sync() .then(() => { console.log('Model synchronized successfully with the database'); })