Skip to content

Commit

Permalink
Merge branch '86-añadir-sistema-de-ayuda' of https://github.com/Arqui…
Browse files Browse the repository at this point in the history
…soft/wiq_es1a into 86-añadir-sistema-de-ayuda
  • Loading branch information
iyanfdezz committed Apr 27, 2024
2 parents 5dcfd11 + 8a2d2c7 commit 7e8e4e9
Show file tree
Hide file tree
Showing 60 changed files with 2,387 additions and 729 deletions.
61 changes: 39 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,42 @@ jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm --prefix users/authservice ci
- run: npm --prefix users/userservice ci
- run: npm --prefix gatewayservice ci
- run: npm --prefix questionservice ci
- run: npm --prefix statsservice ci
- run: npm --prefix webapp ci
- run: npm --prefix users/authservice test -- --coverage
- run: npm --prefix users/userservice test -- --coverage
- run: npm --prefix gatewayservice test -- --coverage
- run: npm --prefix statsservice test -- --coverage
- run: npm --prefix webapp test -- --coverage
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm --prefix users/authservice ci
- run: npm --prefix users/userservice ci
- run: npm --prefix gatewayservice ci
- run: npm --prefix questionservice ci
- run: npm --prefix statsservice ci
- run: npm --prefix webapp ci
- run: npm --prefix users/authservice test -- --coverage
- run: npm --prefix users/userservice test -- --coverage
- run: npm --prefix gatewayservice test -- --coverage
- run: npm --prefix statsservice test -- --coverage
- run: npm --prefix webapp test -- --coverage
- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
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/authservice install
- run: npm --prefix users/userservice install
- run: npm --prefix gatewayservice install
- run: npm --prefix questionservice install
- run: npm --prefix statsservice install
- run: npm --prefix webapp install
- run: npm --prefix webapp run build
- run: npm --prefix webapp run test:e2e
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ services:
- "3000:3000"
environment:
REACT_APP_API_ENDPOINT: http://gatewayservice:8000
restart: always

prometheus:
image: prom/prometheus
Expand All @@ -115,6 +116,7 @@ services:
- "9090:9090"
depends_on:
- gatewayservice
restart: always

grafana:
image: grafana/grafana
Expand All @@ -134,6 +136,7 @@ services:
- "9091:9091"
depends_on:
- prometheus
restart: always


volumes:
Expand Down
Binary file added docs/images/12-authservice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/12-e2e.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/12-gatewayservice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/12-statsservice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/12-userservice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/12-webapp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/juicy-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/juicy-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/pagespeed-classic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/pagespeed-stats.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/usability-averages.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/usability-graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/usability-table.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 83 additions & 0 deletions docs/src/12_testing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,89 @@ ifndef::imagesdir[:imagesdir: ../images]

This section details the results of the various types of tests that have been carried out with the application.

=== Unit Testing

We used Jest to perform unit testing on the application. We have written tests for all the components of the application, mocking the database and external services. All the tests passed successfully. The results of the tests are shown below:

=== Auth service
image::12-authservice.png[]

=== User service
image::12-userservice.png[]

=== Gateway service
image::12-gatewayservice.png[]

=== Stats service
image::12-statsservice.png[]

=== Webapp
image::12-webapp.png[]

== e2e Testing
We used puppeteer to perform end-to-end testing on the application. We have written tests for login, register, create group, and for the three gamemodes.

image::12-e2e.png[]

=== Code coverage

We used sonarCloud to check the code coverage of the application. The results are shown below:

=== Usability and accessibility Testing

We used some tools to measure usability levels of the application, along with some testing with real users (friends and family).

==== Automatic tools:

First, we will show the automatic tools results:

===== PageSpeed Insights:

This tool is used to measure different aspects of a certain page, such as performance, accessibility, best practices and optimisation.
We used this tool on all of our pages, and the results were kind of similar. Below, the results for the Classic and Stats page are shown:

image::pagespeed-stats.png[]

image::pagespeed-classic.png[]

As we can see, our pages perform very nicely on every evaluable aspect, except in Best practices, and that's because the tool is giving us a
warning because we don't use HTTPS in our application, which can lead to security issues.

===== Juicy Studio:
This tool is used to measure the contrast between background and foreground colors of a web page.
We used this tool on both of out color combinations: dark mode and light mode. The results are shown below:

image::juicy-light.png[]

image::juicy-dark.png[]

As we can see, both of our themes use correct and high-contrasted color combinations.

==== Testing with real users:

We did some testing with 18 people, all of them being friends and family of us, the develpoment team.
We let them try the application, play games, view their stats, create groups, etc., and when they were
finished we asked them a few questions.
We wanted to get from each individual his UI rating, functionality rating and some recommendation of things we could change / add
if we continued developing the app.

The results of this test are shown below:

image::usability-table.png[]

image::usability-averages.png[]

As we can see, we have attempted to conduct tests with people of various ages, and approximately the same number of men and women,
in order to obtain different perspectives and a broader and more diverse range of users.
We consider the results to be very positive, judging by the average of the scores obtained.

image::usability-graph.png[]

However, looking at the recommendations made by our testers, we think it would be a good idea to work on upgrading the group system, adding
administrators, invitations, and private groups, and adding friend requests.
We should also consider improving our UI, maybe studying design tendencies and trying to applicate them to our project.


=== Load Testing
We used Gatling to perform load testing on the application. It consisted of simulating 1000 users accessing the application at the same time, each of one performing 83 requests. The results of the test are shown below:

Expand Down
4 changes: 2 additions & 2 deletions gatewayservice/gateway-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ app.get("/health", (req, res) => {
res.json({ status: "OK" });
});

var returnError = (res, error) => {
let returnError = (res, error) => {
console.log(error);
res.status(error.response.status).json({ error: error.response.data.error });
}
Expand Down Expand Up @@ -246,7 +246,7 @@ app.get("/ranking", async (req, res) => {
}
});

var openapiPath='./openapi.yaml'
let openapiPath='./openapi.yaml'
if (fs.existsSync(openapiPath)) {
const file = fs.readFileSync(openapiPath, 'utf8');

Expand Down
Loading

0 comments on commit 7e8e4e9

Please sign in to comment.