Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare testing with profiles #789

Closed
wants to merge 22 commits into from
Closed

Prepare testing with profiles #789

wants to merge 22 commits into from

Conversation

mhdirkse
Copy link
Member

No description provided.

@mhdirkse
Copy link
Member Author

This pull request creates all tests dynamically based on Cypress environment variable "selection". Within test code, this variable can be read with the expression Cypress.env('selection'). Cypress shows errors for spec files that do not have tests. For this reason, I create a dummy test. The name of the dummy test shows the value of Cypress.env('selection') that is the reason for not creating the tests.

The environment variable is set in cypress.env.json. This is better then doing it on the command line, because the command lines appear as scripts in package.json. There are already many scripts for the different ways of testing. If we would make a script for every combination of a test approach and a test selection, the number of scripts would explode.

In GitHub Actions we have a list of all test selections we want to test. This is an array in which each element is a choice for Cypress.env('selection'). Using the GitHub matrix syntax, a job is started for each option. Each option is executed.

Having options to select tests only makes sense if we apply different Spring profiles of the backend for each option. This will be configured by writing frank-runner/specials/ladybug/build.properties. This part is not yet implemented because we do not know what Spring profiles to test with.

@mhdirkse
Copy link
Member Author

De verschillende jobs verschijnen in een pull request als verschillende testen die moeten slagen:
image

In de Actions tab is er één scherm waar de verschillende jobs bij elkaar staan:
image

@mhdirkse
Copy link
Member Author

@jacodg je hebt me net uitgelegd welke test met verschillende Spring profielen we nodig hebben. Ik maak deze PR af zodat ook het backend stuk daarvan gedaan wordt. Ik wou nog even uitstellen dat we nog iets te doen hebben voor handmatig testen. Als je handmatig wilt testen, dan moet je met de hand frank-runner/specials/ladybug/build.properties schrijven inclusief de selectie van een Spring profiel. Daarna moet je daar restart.bat of restart.sh starten. Pas als de backend dan draait, dan kan je de frontend testen waarbij je op moet letten dat cypress.env.json goed is. Dat zijn te veel handelingen om aan te denken.

@mhdirkse
Copy link
Member Author

Ik denk dat het handig is om dat in de pom.xml van ladybug-backend te maken, zodat je met één enkel Maven commando de test van je keuze kunt doen. Die test logica zou denk ik wel gebruik kunnen maken van de tooling van de frank-runner. Maar niet voor nu dus.

@mhdirkse
Copy link
Member Author

Ik denk dat het zo goed is. De test heeft op vier manieren gedraaid:

  • Frontend van ng serve, zonder verandering van Spring profiel.
  • Frontend van ng serve, met Spring profiel storage.xml.
  • Frontend van backend, zonder verandering van Spring profiel. Faalt omdat de nieuwste testen draaien tegen code waarin de functionaliteit nog niet toegevoegd is.
  • Frontend van backend, met Spring profiel storage.xml.

@mhdirkse
Copy link
Member Author

mhdirkse commented Dec 3, 2024

Superseded by #803.

@mhdirkse mhdirkse closed this Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant