Skip to content

Commit

Permalink
quito del release los demas microservicios (?)
Browse files Browse the repository at this point in the history
añadido el comando del exec

Some minor changes to deploy e2e

Removing mongo memory server

Update package json to remove mongo memory server

Adding the ci

Debugging node and npm versions as well as directory content

Now should work

Using custom

Incoming

Adding all

Undo a lot of things,back to old test execution without docker

Removing not necesary sleeo

Last changes

Update package-lock webapp

Adding the authservice

Increasing the timeouts

Modifying the release.yml to have some traces

Increase the timeout
  • Loading branch information
uo282189 authored and augustocristian committed Apr 30, 2024
1 parent d9e29e7 commit 5641542
Show file tree
Hide file tree
Showing 12 changed files with 7,878 additions and 31,018 deletions.
177 changes: 18 additions & 159 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,175 +19,34 @@ jobs:
user: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.DEPLOY_KEY }}
command: |
rm -r ./e2e
exec bash \-l
cd ~
echo "Node.js version: $(node --version) npm version: $(npm --version)"
wget https://raw.githubusercontent.com/arquisoft/wiq_es05c/master/docker-compose.yml -O docker-compose.yml
wget https://raw.githubusercontent.com/arquisoft/wiq_es05c/master/.env -O .env
docker compose --profile prod down
sudo rm -r ./e2e
git clone https://github.com/Arquisoft/wiq_es05c.git e2e
cd e2e
docker compose --profile prod down
git checkout e2e # Acordarse de eliminar esto en main
git status
export GITHUB_ACTIONS=true
echo "The value of GITHUB ACTIONS is: $GITHUB_ACTIONS"
echo "Building authservice"
npm --prefix users/authservice install
echo "Building userservice"
npm --prefix users/userservice install
echo "Building gatewayservice"
npm --prefix gatewayservice install
echo "Building historyservice"
npm --prefix historyservice install
echo "Building questionservice"
npm --prefix questionservice install
echo "Building roomservice"
npm --prefix roomservice install
echo "Building webapp"
npm --prefix webapp install
npm --prefix webapp run build
docker compose --profile prod up -d --pull always
sleep 30
npm --prefix webapp run build
echo "Executing E2E test suite"
npm --prefix webapp run test:e2e
docker-push-roomservice:
name: Push room service Docker Image to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs: [e2etests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: arquisoft/wiq_es05c/roomservice
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: roomservice
buildargs: REACT_APP_API_URI
env: # Esta línea estaba mal indentada
REACT_APP_API_URI: http://${{ secrets.DEPLOY_HOST }}:3000

docker-push-webapp:
name: Push webapp Docker Image to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs: [e2etests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
env:
REACT_APP_API_URI: http://${{ secrets.DEPLOY_HOST }}:8000
REACT_APP_SOCKET_URI: http://${{ secrets.DEPLOY_HOST }}:8005
with:
name: arquisoft/wiq_es05c/webapp
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: webapp
buildargs: REACT_APP_API_URI,REACT_APP_SOCKET_URI

docker-push-questionservice:
name: Push question service Docker Image to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs: [e2etests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: arquisoft/wiq_es05c/questionservice
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: questionservice

docker-push-historyservice:
name: Push question service Docker Image to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs: [e2etests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: arquisoft/wiq_es05c/historyservice
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: historyservice

docker-push-authservice:
name: Push auth service Docker Image to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs: [e2etests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: arquisoft/wiq_es05c/authservice
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: users/authservice

docker-push-userservice:
name: Push user service Docker Image to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs: [e2etests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: arquisoft/wiq_es05c/userservice
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: users/userservice

docker-push-gatewayservice:
name: Push gateway service Docker Image to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs: [e2etests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: arquisoft/wiq_es05c/gatewayservice
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: gatewayservice
docker-push-grafana:
name: Push Grafana Docker Image to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs: [e2etests]
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: arquisoft/wiq_es05c/grafana
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: grafana
buildargs: GF_SECURITY_ADMIN_PASSWORD
env:
GF_SECURITY_ADMIN_PASSWORD: ${{ secrets.GF_SECURITY_ADMIN_PASSWORD }}

2 changes: 1 addition & 1 deletion webapp/e2e/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
testMatch: ["**/steps/*.js"],
testTimeout: 30000,
testTimeout: 60000,
setupFilesAfterEnv: ["expect-puppeteer"]
}
2 changes: 1 addition & 1 deletion webapp/e2e/steps/basicButtons-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defineFeature(feature, test => {
: await puppeteer.launch({ headless: false, slowMo: 20 });
page = await browser.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 10000 })
setDefaultOptions({ timeout: 40000 })

await page
.goto("http://localhost:3000/addUser", {
Expand Down
2 changes: 1 addition & 1 deletion webapp/e2e/steps/dailyQuestionMode-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ defineFeature(feature, test => {
: await puppeteer.launch({ headless: false, slowMo: 20 });
page = await browser.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 10000 })
setDefaultOptions({ timeout: 40000 })

await page
.goto("http://localhost:3000/addUser", {
Expand Down
2 changes: 1 addition & 1 deletion webapp/e2e/steps/gameBasicMode-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ defineFeature(feature, test => {
: await puppeteer.launch({ headless: false, slowMo: 20 });
page = await browser.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 10000 })
setDefaultOptions({ timeout: 40000 })

await page
.goto("http://localhost:3000/addUser", {
Expand Down
2 changes: 1 addition & 1 deletion webapp/e2e/steps/login-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ defineFeature(feature, test => {
: await puppeteer.launch({ headless: false, slowMo: 50 });
page = await browser.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 10000 })
setDefaultOptions({ timeout: 40000 })

await page
.goto("http://localhost:3000/login", {
Expand Down
4 changes: 2 additions & 2 deletions webapp/e2e/steps/multiplayerMode-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ defineFeature(feature, test => {
: await puppeteer.launch({ headless: false, slowMo: 20 });
pageHost = await browserHost.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 10000 })
setDefaultOptions({ timeout: 40000 })

browserUser = process.env.GITHUB_ACTIONS
? await puppeteer.launch()
: await puppeteer.launch({ headless: false, slowMo: 20 });
pageUser = await browserUser.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 10000 })
setDefaultOptions({ timeout: 40000 })

await pageHost
.goto("http://localhost:3000/addUser", {
Expand Down
2 changes: 1 addition & 1 deletion webapp/e2e/steps/register-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ defineFeature(feature, test => {
: await puppeteer.launch({ headless: false, slowMo: 20 });
page = await browser.newPage();
//Way of setting up the timeout
setDefaultOptions({ timeout: 10000 })
setDefaultOptions({ timeout: 40000 })

await page
.goto("http://localhost:3000/login", {
Expand Down
2 changes: 1 addition & 1 deletion webapp/e2e/test-environment-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ async function startServer() {
testQuestions.insertTestData();
}

startServer();
startServer();
7 changes: 3 additions & 4 deletions webapp/e2e/testQuestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async function insertTestData() {
const categoryCollection = database.collection('categorias');
const answersCollection = database.collection('respuestas');
const typesCollection = database.collection('tipos');

// insertamos las categorias
await categoryCollection.insertMany([
{
Expand Down Expand Up @@ -95,12 +95,11 @@ async function insertTestData() {
testQuestions[0].diaria = formattedDate;

// insertamos las preguntas
await questionsCollection.insertMany(testQuestions);

await questionsCollection.insertMany(testQuestions);

} finally {
await client.close(); // Cerrar la conexión con la base de datos
}
}

module.exports = { insertTestData };
module.exports = { insertTestData };
Loading

0 comments on commit 5641542

Please sign in to comment.