Skip to content

fix(cypress): update tests to suport multi tenancy

Sidorela Uku requested to merge single-test-pipeline into main

This MR is for creating a single test pipeline that supports also multi-tenancy, continues work for issues #1336 (closed) .

Configuration changes:

  • gitlab-ci.yml is the main file that informs what will run in the pipeline. Lines 12-19 & 69-84 where from the previous configuration where we had 3 pipelines running everytime a new change is committed, those can be deleted although I only commented for the moment. Lines from 21-67, where for scheduled test pipelines for specific devices that would run only once a day/week. Those as well were not fully configured to run, so I commented them out.
  • Currently in step 1, where made the app to build on multi tenancy by setting the INSTANCE_GROUPS: journal:aperture,prc:colab,single_form:elife.
  • Configuration for the pipeline are in the file gitlab-ci.config.yml, this has the build and test stages. During chrome and firefox pipeline all the test cases inside the cypress/e2e folder will run. This pipeline will run on every commit.
  • The other .yml files are not necessary unless we want to configure scheduled pipelines for specific devices/browsers.
  • The gitlab-ci.config.yml is using the IMAGE_NAME=kotahi-elife, since I needed an image to build the app. This can be changed.

Test file updates:

  • Updated the routes, by creating a separate file for each archetype. This was faster to implement as a solution to not break the tests.
  • Updated the dumps for each instance to seed based on the archetype. Updated the rest of the dumps to used the group_id of the archetype that we are testing.
  • For the 3 archetypes the dumps inside /commons folder will stay like that, as this is the user data we seed for each case after the inital data is done from the migrations. It's not necessary to create a single dump with all the data, because we will login to one archetype at a time in a test case. This also avoids seeding the db with unnecessary data for each test case.
  • Deleted the initalState.sql, because is not being used.
  • Commented out the seedForms inside the tests because the forms are already populated from the migrations. This can be removed totally.
  • Skipped the runs of ncrc tests, since with the single pipeline all the tests inside e2e folder are executed.
Edited by Sidorela Uku

Merge request reports