diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 18c2141d..9161206e 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -282,8 +282,6 @@ jobs:
ELASTIC_PASSWORD: ${{ secrets.ELASTIC_PASSWORD }}
LOGSTASH_INTERNAL_PASSWORD: ${{ secrets.LOGSTASH_INTERNAL_PASSWORD }}
KIBANA_SYSTEM_PASSWORD: ${{ secrets.KIBANA_SYSTEM_PASSWORD }}
- CUSTOM_USER: ${{ secrets.CUSTOM_USER }}
- CUSTOM_USER_PASSWORD: ${{ secrets.CUSTOM_USER_PASSWORD }}
docker-push-elasticsearch:
name: Push elasticsearch service Docker Image to GitHub Packages
@@ -391,7 +389,6 @@ jobs:
GF_SECURITY_ADMIN_PASSWORD: ${{ secrets.GF_SECURITY_ADMIN_PASSWORD }}
GF_SERVER_SERVE_FROM_SUB_PATH: false
GF_SERVER_DOMAIN: cyt.is-cool.dev
- GF_SERVER_HTTP_PORT: 443
GF_SERVER_PROTOCOL: https
docker-push-prometheus:
@@ -449,6 +446,14 @@ jobs:
rm -rf ./*
wget https://raw.githubusercontent.com/arquisoft/wiq_es05b/master/docker-compose.yml -O docker-compose.yml
wget https://raw.githubusercontent.com/arquisoft/wiq_es05b/master/.env -O .env
+ echo "GF_SECURITY_ADMIN_USER=${{ secrets.GF_SECURITY_ADMIN_USER }}" >> .env
+ echo "GF_SECURITY_ADMIN_PASSWORD=${{ secrets.GF_SECURITY_ADMIN_PASSWORD }}" >> .env
+ echo "GF_SERVER_SERVE_FROM_SUB_PATH=false" >> .env
+ echo "GF_SERVER_DOMAIN=cyt.is-cool.dev" >> .env
+ echo "GF_SERVER_PROTOCOL=http" >> .env
+ echo "ELASTIC_PASSWORD=${{ secrets.ELASTIC_PASSWORD }}" >> .env
+ echo "LOGSTASH_INTERNAL_PASSWORD=${{ secrets.LOGSTASH_INTERNAL_PASSWORD }}" >> .env
+ echo "KIBANA_SYSTEM_PASSWORD=${{ secrets.KIBANA_SYSTEM_PASSWORD }}" >> .env
docker logout ghcr.io
docker logout ghcr
docker image prune -f
diff --git a/cyt-utils/package.json b/cyt-utils/package.json
index a031f951..64ba74b5 100644
--- a/cyt-utils/package.json
+++ b/cyt-utils/package.json
@@ -1,6 +1,6 @@
{
"name": "cyt-utils",
- "version": "6.0.0",
+ "version": "6.1.0",
"description": "A variety of utilities for the project",
"main": "index.js",
"scripts": {
diff --git a/docker-compose.yml b/docker-compose.yml
index 4239db77..7dc32d75 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,4 +1,3 @@
-version: '3'
services:
# Production services
@@ -209,6 +208,8 @@ services:
- "9090:9090"
depends_on:
- gatewayservice
+ restart:
+ always
grafana:
image: ghcr.io/arquisoft/wiq_es05b/grafana:latest
@@ -228,12 +229,12 @@ services:
- GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD:-changeme}
- GF_SERVER_SERVE_FROM_SUB_PATH=${GF_SERVER_SERVE_FROM_SUB_PATH:-true}
- GF_SERVER_DOMAIN=${GF_SERVER_DOMAIN:-}
- - GF_SERVER_HTTP_PORT=${GF_SERVER_HTTP_PORT:-}
- - GF_SERVER_PROTOCOL=${GF_PROTOCOL:-}
+ - GF_SERVER_PROTOCOL=${GF_SERVER_PROTOCOL:-}
ports:
- "9091:9091"
depends_on:
- prometheus
+ restart: always
volumes:
mongo_data:
diff --git a/jordi/WikidataGenerator.js b/jordi/WikidataGenerator.js
index 845eb8e4..7796a95d 100644
--- a/jordi/WikidataGenerator.js
+++ b/jordi/WikidataGenerator.js
@@ -77,11 +77,7 @@ class WikidataGenerator {
});
- return questions;
-
- } else {
- throw new Error("No Data found")
- }
+ return questions; } else { throw new Error("No Data found") }
}
diff --git a/jordi/jordi-service.js b/jordi/jordi-service.js
index 5001a946..f33afdb9 100644
--- a/jordi/jordi-service.js
+++ b/jordi/jordi-service.js
@@ -74,12 +74,14 @@ if (generateOnStartup) {
.catch(e => console.log("Oh no", e));
}
+// Disabled because of bugs in the library
+//
// * second * minute * hour * date * month * year
-cron.schedule(schedule, () => {
- console.log("Running script at : " + new Date());
- script(groupsRepository, questionsRepository, WikidataGenerator)
- .catch(e => console.log("Oh no", e));
-}, {
- scheduled: true,
- timezone: "Europe/Madrid"
-});
\ No newline at end of file
+// cron.schedule(schedule, () => {
+// console.log("Running script at : " + new Date());
+// script(groupsRepository, questionsRepository, WikidataGenerator)
+// .catch(e => console.log("Oh no", e));
+// }, {
+// scheduled: true,
+// timezone: "Europe/Madrid"
+// });
diff --git a/jordi/jordi-service.test.js b/jordi/jordi-service.test.js
index d6013b9d..06fdfbfa 100644
--- a/jordi/jordi-service.test.js
+++ b/jordi/jordi-service.test.js
@@ -203,16 +203,26 @@ describe("[Jordi Service] - /categories", () => {
it("Should return 200 and an array of categories", async () => {
axios.get.mockImplementation(() => Promise.resolve(WikidataMock));
+
await request(app).post("/addGroups").send(groups);
await request(app).get("/gen");
- const response = await request(app).get('/categories');
+ let response = await request(app).get('/categories');
expect(response.status).toBe(200);
expect(response).toHaveProperty("text");
expect(response.text).toEqual("[\"area\",\"capitals\",\"continent\",\"currency\",\"economy\",\"gdp\",\"geography\",\"languages\",\"politics\",\"population\",\"president\",\"religion\"]");
+ await request(app).get("/removeAllGroups");
+
+ response = await request(app).get('/categories');
+
+ expect(response.status).toBe(200);
+ expect(response).toHaveProperty("text");
+
+ expect(response.text).toBe("[]");
+
});
it("Should return 200 and an empty array of categories if the database is empty", async () => {
@@ -226,6 +236,7 @@ describe("[Jordi Service] - /categories", () => {
expect(response.text).toBe("[]");
});
+
});
describe("[Jordi Service] - /questions/:category/:n", () => {
@@ -289,6 +300,7 @@ app2.set("i18next", require("i18next"))
routes(app2, mockQuestionsRepository);
describe('Routes', () => {
+
it('fetches categories', async () => {
mockQuestionsRepository.getCategories.mockResolvedValue([]);
const res = await request(app2).get('/categories');
@@ -319,4 +331,5 @@ describe('Routes', () => {
const res = await request(app2).get('/questions/category/invalid');
expect(res.statusCode).toEqual(400);
});
+
});
\ No newline at end of file
diff --git a/jordi/package.json b/jordi/package.json
index 1df427a2..9ba2c5f0 100644
--- a/jordi/package.json
+++ b/jordi/package.json
@@ -8,7 +8,7 @@
"scripts": {
"start": "node jordi-service.js",
"dev": "nodemon jordi-service.js",
- "test": "jest"
+ "test": "jest --coverage"
},
"repository": {
"type": "git",
diff --git a/jordi/repositories/questionRepository.js b/jordi/repositories/questionRepository.js
index a0c99b84..d8297d15 100644
--- a/jordi/repositories/questionRepository.js
+++ b/jordi/repositories/questionRepository.js
@@ -23,10 +23,7 @@ module.exports = {
await this.checkUp();
return await this.mongoose.connection
.collection(this.collectionName)
- .distinct("categories");
- } catch (error) {
- throw error.message;
- }
+ .distinct("categories"); } catch (error) { throw error.message; }
},
checkCategory: async function (category) {
@@ -35,10 +32,7 @@ module.exports = {
const result = await this.mongoose.connection
.collection(this.collectionName)
.distinct("categories");
- return result.some((x) => x === category);
- } catch (e) {
- throw e.message;
- }
+ return result.some((x) => x === category); } catch (error) { throw error.message; }
},
getQuestions: async function (category, n = 10) {
@@ -57,10 +51,7 @@ module.exports = {
question.options = await this.getDistinctOptions(question);
}
- return result;
- } catch (error) {
- throw error.message;
- }
+ return result; } catch (error) { throw error.message; }
},
insertQuestions: async function (questions) {
@@ -68,10 +59,7 @@ module.exports = {
await this.checkUp();
await this.mongoose.connection
.collection(this.collectionName)
- .insertMany(questions);
- } catch (error) {
- throw error.message;
- }
+ .insertMany(questions); } catch (error) { throw error.message; }
},
deleteQuestions: async function (groupId) {
@@ -79,16 +67,20 @@ module.exports = {
await this.checkUp();
await this.mongoose.connection
.collection(this.collectionName)
- .deleteMany({ groupId });
- } catch (error) {
- throw error.message;
- }
+ .deleteMany({ groupId }); } catch (error) { throw error.message; }
},
- getDistinctOptions: async function (question) {
- // FIXME: Make it distinct and exclude the answer
- // also make sure there are always 4 options at the end
+ removeQuestions: async function (filter, options) {
+ console.log("XD")
+ try {
+ await this.checkUp();
+ await this.mongoose.connection
+ .collection(this.collectionName)
+ .deleteMany(filter, options); } catch (error) { throw error.message; }
+ },
+
+ getDistinctOptions: async function (question) {
try {
await this.checkUp();
let result = (
diff --git a/jordi/routes/jordi-think.js b/jordi/routes/jordi-think.js
index b09dc7af..8c817c32 100644
--- a/jordi/routes/jordi-think.js
+++ b/jordi/routes/jordi-think.js
@@ -53,13 +53,17 @@ module.exports = function (app, questionsRepository, groupsRepository) {
try {
const { groupId } = req.params;
await groupsRepository.removeGroups({ groupId: groupId });
+ await questionsRepository.deleteQuestions({ groupId: groupId });
res.json({ message: i18next.t("group_removed") })
} catch (error) { next(error); }
});
app.get("/removeAllGroups", async (req, res, next) => {
try {
+
await groupsRepository.removeGroups();
+ await questionsRepository.removeQuestions();
+
res.json({ message: i18next.t("all_groups_removed") });
} catch (error) { next(error); }
});
diff --git a/logging/setup/start.sh b/logging/setup/start.sh
index e05112a6..e20a90ec 100644
--- a/logging/setup/start.sh
+++ b/logging/setup/start.sh
@@ -13,6 +13,7 @@ declare -A users_passwords
users_passwords=(
[logstash_internal]="${LOGSTASH_INTERNAL_PASSWORD:-}"
[kibana_system]="${KIBANA_SYSTEM_PASSWORD:-}"
+ [elastic]="${ELASTIC_PASSWORD:-}"
# [metricbeat_internal]="${METRICBEAT_INTERNAL_PASSWORD:-}"
# [filebeat_internal]="${FILEBEAT_INTERNAL_PASSWORD:-}"
# [heartbeat_internal]="${HEARTBEAT_INTERNAL_PASSWORD:-}"
diff --git a/monitoring/grafana/grafana.ini b/monitoring/grafana/grafana.ini
index 884ec51a..d8bff161 100644
--- a/monitoring/grafana/grafana.ini
+++ b/monitoring/grafana/grafana.ini
@@ -53,7 +53,7 @@
# The full public facing url you use in browser, used for redirects and emails
# If you use reverse proxy and sub path specify full url (with sub path)
-root_url = %(protocol)s://%(domain)s:%(http_port)s/grafana
+root_url = %(protocol)s://%(domain)s:%(http_port)s/grafana/
# Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons.
serve_from_sub_path = true
diff --git a/proxy/default.conf b/proxy/default.conf
index f7d99884..62d3ef33 100644
--- a/proxy/default.conf
+++ b/proxy/default.conf
@@ -25,6 +25,8 @@ server {
proxy_pass http://grafana:9091/;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /robots.txt {
diff --git a/sonar-project.properties b/sonar-project.properties
index ed80cb93..8e723420 100644
--- a/sonar-project.properties
+++ b/sonar-project.properties
@@ -11,7 +11,7 @@ sonar.language=js
sonar.coverage.exclusions=**/*.test.js,**/*.draft.js
sonar.cpd.exclusions=**/*.test.js,**/*.draft.js
-sonar.sources=.
+sonar.sources=users/authservice,users/userservice,gatewayservice,webapp/src,userhistory,jordi
sonar.sourceEncoding=UTF-8
sonar.exclusions=node_modules/**
-sonar.javascript.lcov.reportPaths=**/coverage/lcov.info
\ No newline at end of file
+sonar.javascript.lcov.reportPaths=**/coverage/lcov.info
diff --git a/webapp/loadTest/PlayGame.scala b/webapp/loadTest/PlayGame.scala
new file mode 100644
index 00000000..a80d834d
--- /dev/null
+++ b/webapp/loadTest/PlayGame.scala
@@ -0,0 +1,192 @@
+package wiq
+
+class PlayGame extends Simulation {
+
+ private val httpProtocol = http
+ .baseUrl("https://cyt.is-cool.dev")
+ .inferHtmlResources()
+ .acceptHeader("application/json, text/plain, */*")
+ .acceptEncodingHeader("gzip, deflate, br")
+ .acceptLanguageHeader("en")
+ .userAgentHeader("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0")
+
+ private val headers_0 = Map(
+ "Accept" -> "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
+ "Accept-Language" -> "es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3",
+ "If-None-Match" -> "c49c469e11c898b25c7c0a68a460ae63544d991a",
+ "Sec-Fetch-Dest" -> "document",
+ "Sec-Fetch-Mode" -> "navigate",
+ "Sec-Fetch-Site" -> "none",
+ "Sec-Fetch-User" -> "?1",
+ "Upgrade-Insecure-Requests" -> "1"
+ )
+
+ private val headers_1 = Map(
+ "Accept" -> "*/*",
+ "Accept-Language" -> "es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3",
+ "If-None-Match" -> "ca400ec24dddb7a81451d193b0ca9221a784c7af",
+ "Sec-Fetch-Dest" -> "script",
+ "Sec-Fetch-Mode" -> "no-cors",
+ "Sec-Fetch-Site" -> "same-origin"
+ )
+
+ private val headers_2 = Map(
+ "Accept" -> "image/avif,image/webp,*/*",
+ "Accept-Language" -> "es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3",
+ "Sec-Fetch-Dest" -> "image",
+ "Sec-Fetch-Mode" -> "no-cors",
+ "Sec-Fetch-Site" -> "same-origin"
+ )
+
+ private val headers_4 = Map(
+ "Content-Type" -> "application/json",
+ "Origin" -> "https://cyt.is-cool.dev",
+ "Sec-Fetch-Dest" -> "empty",
+ "Sec-Fetch-Mode" -> "cors",
+ "Sec-Fetch-Site" -> "same-origin"
+ )
+
+ private val headers_5 = Map(
+ "If-None-Match" -> """W/"76-pBSD2dRbUFUs2hjALc0lZ9/PUFo"""",
+ "Sec-Fetch-Dest" -> "empty",
+ "Sec-Fetch-Mode" -> "cors",
+ "Sec-Fetch-Site" -> "same-origin",
+ "authorization" -> "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NjMxNWJkYTM3YzJlM2IxNWU4N2U4MTkiLCJpYXQiOjE3MTQ1MTA4ODQsImV4cCI6MTcxNDUyNTI4NH0.nqg7QMZ1LJbl3w9--OIOlP6D2qVrYt6JUX-FTGK5Q6s"
+ )
+
+ private val headers_7 = Map(
+ "If-None-Match" -> """W/"79f-hZwvqvlLjGWHnaqfQMNU0O4SMG4"""",
+ "Sec-Fetch-Dest" -> "empty",
+ "Sec-Fetch-Mode" -> "cors",
+ "Sec-Fetch-Site" -> "same-origin",
+ "authorization" -> "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2NjMxNWJkYTM3YzJlM2IxNWU4N2U4MTkiLCJpYXQiOjE3MTQ1MTA4ODQsImV4cCI6MTcxNDUyNTI4NH0.nqg7QMZ1LJbl3w9--OIOlP6D2qVrYt6JUX-FTGK5Q6s"
+ )
+
+ private val headers_8 = Map(
+ "Accept" -> "image/avif,image/webp,*/*",
+ "Accept-Language" -> "es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3",
+ "If-None-Match" -> "fa22e4493f8dd64e51cb96adb8b94c0a4f662cc5",
+ "Sec-Fetch-Dest" -> "image",
+ "Sec-Fetch-Mode" -> "no-cors",
+ "Sec-Fetch-Site" -> "same-origin"
+ )
+
+ private val headers_9 = Map(
+ "Accept" -> "image/avif,image/webp,*/*",
+ "Accept-Language" -> "es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3",
+ "If-None-Match" -> "a377f3e105a0c58c455537c232a8bdab017962c4",
+ "Sec-Fetch-Dest" -> "image",
+ "Sec-Fetch-Mode" -> "no-cors",
+ "Sec-Fetch-Site" -> "same-origin"
+ )
+
+ private val headers_20 = Map(
+ "Accept" -> "image/avif,image/webp,*/*",
+ "Accept-Language" -> "es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3",
+ "If-None-Match" -> "0b13ee8600e3b97ab410ea19942780d76e9756c5",
+ "Sec-Fetch-Dest" -> "image",
+ "Sec-Fetch-Mode" -> "no-cors",
+ "Sec-Fetch-Site" -> "same-origin"
+ )
+
+
+ private val scn = scenario("PlayGame")
+ .exec(
+ http("request_0")
+ .get("/home")
+ .headers(headers_0)
+ .resources(
+ http("request_1")
+ .get("/static/js/main.883c6c3c.js")
+ .headers(headers_1),
+ http("request_2")
+ .get("/logo192.png")
+ .headers(headers_2),
+ http("request_3")
+ .get("/logo192.png")
+ .headers(headers_2)
+ ),
+ pause(17),
+ http("request_4")
+ .post("/api/login")
+ .headers(headers_4)
+ .body(RawFileBody("wiq/playgame/0004_request.json"))
+ .resources(
+ http("request_5")
+ .get("/api/game/categories")
+ .headers(headers_5)
+ ),
+ pause(3),
+ http("request_6")
+ .post("/api/history/create")
+ .headers(headers_4)
+ .body(RawFileBody("wiq/playgame/0006_request.json"))
+ .resources(
+ http("request_7")
+ .get("/api/game/questions/capitals/10")
+ .headers(headers_7),
+ http("request_8")
+ .get("/static/media/coin.min.3ce18f0c750fafeebf39e280876ac2b9.svg")
+ .headers(headers_8),
+ http("request_9")
+ .get("/static/media/border.ad2f658a1b45ceb1d7a3.png")
+ .headers(headers_9),
+ http("request_10")
+ .post("/api/game/answer?isHot=false")
+ .headers(headers_4)
+ .body(RawFileBody("wiq/playgame/0010_request.json"))
+ ),
+ pause(2),
+ http("request_11")
+ .post("/api/game/answer?isHot=false")
+ .headers(headers_4)
+ .body(RawFileBody("wiq/playgame/0011_request.json")),
+ pause(2),
+ http("request_12")
+ .post("/api/game/answer?isHot=false")
+ .headers(headers_4)
+ .body(RawFileBody("wiq/playgame/0012_request.json")),
+ pause(3),
+ http("request_13")
+ .post("/api/game/answer?isHot=false")
+ .headers(headers_4)
+ .body(RawFileBody("wiq/playgame/0013_request.json")),
+ pause(2),
+ http("request_14")
+ .post("/api/game/answer?isHot=false")
+ .headers(headers_4)
+ .body(RawFileBody("wiq/playgame/0014_request.json")),
+ pause(1),
+ http("request_15")
+ .post("/api/game/answer?isHot=false")
+ .headers(headers_4)
+ .body(RawFileBody("wiq/playgame/0015_request.json")),
+ pause(1),
+ http("request_16")
+ .post("/api/game/answer?isHot=false")
+ .headers(headers_4)
+ .body(RawFileBody("wiq/playgame/0016_request.json")),
+ pause(1),
+ http("request_17")
+ .post("/api/game/answer?isHot=false")
+ .headers(headers_4)
+ .body(RawFileBody("wiq/playgame/0017_request.json")),
+ pause(1),
+ http("request_18")
+ .post("/api/game/answer?isHot=false")
+ .headers(headers_4)
+ .body(RawFileBody("wiq/playgame/0018_request.json")),
+ pause(1),
+ http("request_19")
+ .post("/api/game/answer?isHot=false")
+ .headers(headers_4)
+ .body(RawFileBody("wiq/playgame/0019_request.json"))
+ .resources(
+ http("request_20")
+ .get("/jordi-celebration.png")
+ .headers(headers_20)
+ )
+ )
+
+ setUp(scn.inject(constantUsersPerSec(38) during (60 seconds)randomized)).protocols(httpProtocol)
+}
diff --git a/webapp/loadTest/gameTest.scala b/webapp/loadTest/gameTest.scala
deleted file mode 100644
index 8c5557b7..00000000
--- a/webapp/loadTest/gameTest.scala
+++ /dev/null
@@ -1,280 +0,0 @@
-package wiq
-
-import scala.concurrent.duration._
-
-import io.gatling.core.Predef._
-import io.gatling.http.Predef._
-import io.gatling.jdbc.Predef._
-
-class GameTest extends Simulation {
-
- private val httpProtocol = http
- .baseUrl("http://localhost:8000")
- .inferHtmlResources()
- .acceptHeader("application/json, text/plain, */*")
- .acceptEncodingHeader("gzip, deflate, br")
- .acceptLanguageHeader("es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3")
- .userAgentHeader("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0")
-
- private val headers_0 = Map(
- "Accept" -> "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
- "If-None-Match" -> "d2ea4fbac4f7f0cbae9f3eb1d54bed1a7efdb11b",
- "Sec-Fetch-Dest" -> "document",
- "Sec-Fetch-Mode" -> "navigate",
- "Sec-Fetch-Site" -> "none",
- "Sec-Fetch-User" -> "?1",
- "Upgrade-Insecure-Requests" -> "1"
- )
-
- private val headers_1 = Map(
- "Accept" -> "*/*",
- "If-None-Match" -> "43236382c85c7998e2676f113a3ff8847f700f07",
- "Sec-Fetch-Dest" -> "script",
- "Sec-Fetch-Mode" -> "no-cors",
- "Sec-Fetch-Site" -> "same-origin"
- )
-
- private val headers_2 = Map(
- "Accept" -> "image/avif,image/webp,*/*",
- "Sec-Fetch-Dest" -> "image",
- "Sec-Fetch-Mode" -> "no-cors",
- "Sec-Fetch-Site" -> "same-origin"
- )
-
- private val headers_4 = Map(
- "Accept" -> "*/*",
- "Access-Control-Request-Headers" -> "content-type",
- "Access-Control-Request-Method" -> "POST",
- "Origin" -> "http://localhost:3000",
- "Sec-Fetch-Dest" -> "empty",
- "Sec-Fetch-Mode" -> "cors",
- "Sec-Fetch-Site" -> "same-site"
- )
-
- private val headers_5 = Map(
- "Content-Type" -> "application/json",
- "Origin" -> "http://localhost:3000",
- "Sec-Fetch-Dest" -> "empty",
- "Sec-Fetch-Mode" -> "cors",
- "Sec-Fetch-Site" -> "same-site"
- )
-
- private val headers_6 = Map(
- "If-None-Match" -> """W/"76-pBSD2dRbUFUs2hjALc0lZ9/PUFo"""",
- "Origin" -> "http://localhost:3000",
- "Sec-Fetch-Dest" -> "empty",
- "Sec-Fetch-Mode" -> "cors",
- "Sec-Fetch-Site" -> "same-site"
- )
-
- private val headers_7 = Map(
- "Origin" -> "http://localhost:3000",
- "Sec-Fetch-Dest" -> "empty",
- "Sec-Fetch-Mode" -> "cors",
- "Sec-Fetch-Site" -> "same-site"
- )
-
- private val headers_9 = Map(
- "Accept" -> "image/avif,image/webp,*/*",
- "If-None-Match" -> "ec64264896193a8fcca03d9fa094c1e9471921f3",
- "Sec-Fetch-Dest" -> "image",
- "Sec-Fetch-Mode" -> "no-cors",
- "Sec-Fetch-Site" -> "same-origin"
- )
-
- private val uri1 = "localhost"
-
- private val scn = scenario("LoginPlay")
- .exec(
- http("request_0")
- .get("http://" + uri1 + ":3000/")
- .headers(headers_0)
- .resources(
- http("request_1")
- .get("http://" + uri1 + ":3000/static/js/main.7900dc74.js")
- .headers(headers_1),
- http("request_2")
- .get("http://" + uri1 + ":3000/logo192.png")
- .headers(headers_2),
- http("request_3")
- .get("http://" + uri1 + ":3000/logo192.png")
- .headers(headers_2)
- ),
- pause(10),
- http("request_4")
- .options("/login")
- .headers(headers_4)
- .resources(
- http("request_5")
- .post("/login")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0005_request.json")),
- http("request_6")
- .get("/categories")
- .headers(headers_6)
- ),
- pause(1),
- http("request_7")
- .get("/questions/area/10")
- .headers(headers_7)
- .resources(
- http("request_8")
- .options("/history/create")
- .headers(headers_4),
- http("request_9")
- .get("http://" + uri1 + ":3000/static/media/coin.d9b2a399ca98dfa306307d962ae97c7b.svg")
- .headers(headers_9),
- http("request_10")
- .get("http://" + uri1 + ":3000/static/media/border.92f314d03f3a855655d1.png")
- .headers(headers_2),
- http("request_11")
- .post("/history/create")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0011_request.json"))
- ),
- pause(2),
- http("request_12")
- .options("/game/answer")
- .headers(headers_4)
- .resources(
- http("request_13")
- .post("/game/answer")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0013_request.json")),
- http("request_14")
- .options("/history/add/66152027945b571613f73b6c")
- .headers(headers_4),
- http("request_15")
- .post("/history/add/66152027945b571613f73b6c")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0015_request.json"))
- ),
- pause(2),
- http("request_16")
- .post("/game/answer")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0016_request.json"))
- .resources(
- http("request_17")
- .post("/history/add/66152027945b571613f73b6c")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0017_request.json"))
- ),
- pause(1),
- http("request_18")
- .post("/game/answer")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0018_request.json"))
- .resources(
- http("request_19")
- .post("/history/add/66152027945b571613f73b6c")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0019_request.json"))
- ),
- pause(1),
- http("request_20")
- .post("/game/answer")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0020_request.json"))
- .resources(
- http("request_21")
- .post("/history/add/66152027945b571613f73b6c")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0021_request.json"))
- ),
- pause(1),
- http("request_22")
- .options("/game/answer")
- .headers(headers_4)
- .resources(
- http("request_23")
- .post("/game/answer")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0023_request.json")),
- http("request_24")
- .options("/history/add/66152027945b571613f73b6c")
- .headers(headers_4),
- http("request_25")
- .post("/history/add/66152027945b571613f73b6c")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0025_request.json"))
- ),
- pause(1),
- http("request_26")
- .post("/game/answer")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0026_request.json"))
- .resources(
- http("request_27")
- .post("/history/add/66152027945b571613f73b6c")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0027_request.json"))
- ),
- pause(1),
- http("request_28")
- .post("/game/answer")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0028_request.json"))
- .resources(
- http("request_29")
- .post("/history/add/66152027945b571613f73b6c")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0029_request.json"))
- ),
- pause(1),
- http("request_30")
- .post("/game/answer")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0030_request.json"))
- .resources(
- http("request_31")
- .post("/history/add/66152027945b571613f73b6c")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0031_request.json"))
- ),
- pause(1),
- http("request_32")
- .post("/game/answer")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0032_request.json"))
- .resources(
- http("request_33")
- .post("/history/add/66152027945b571613f73b6c")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0033_request.json"))
- ),
- pause(1),
- http("request_34")
- .options("/game/answer")
- .headers(headers_4)
- .resources(
- http("request_35")
- .post("/game/answer")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0035_request.json")),
- http("request_36")
- .options("/history/add/66152027945b571613f73b6c")
- .headers(headers_4),
- http("request_37")
- .post("/history/add/66152027945b571613f73b6c")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0037_request.json")),
- http("request_38")
- .options("/addScore")
- .headers(headers_4),
- http("request_39")
- .get("http://" + uri1 + ":3000/jordi-celebration.png")
- .headers(headers_2),
- http("request_40")
- .post("/addScore")
- .headers(headers_5)
- .body(RawFileBody("wiq/loginplay/0040_request.json"))
- .check(status.is(503))
- )
- )
-
- setUp(
- scn.inject(constantUsersPerSec(2) during (120 seconds)
- randomized)
- ).protocols(httpProtocol)
-}
diff --git a/webapp/loadTest/results/gameResult/index.html b/webapp/loadTest/results.GameResults/index.html
similarity index 52%
rename from webapp/loadTest/results/gameResult/index.html
rename to webapp/loadTest/results.GameResults/index.html
index 356b5a74..3ef59201 100644
--- a/webapp/loadTest/results/gameResult/index.html
+++ b/webapp/loadTest/results.GameResults/index.html
@@ -3,20 +3,20 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Gatling Stats - Global Information
@@ -36,14 +36,14 @@
Try
-
-
+
+