Skip to content

add instructions for running specific tests - #1980

Merged
lorerod merged 2 commits into
mainfrom
1960-test-specific-execution-guide
Sep 9, 2025
Merged

lorerod merged 2 commits into
mainfrom
1960-test-specific-execution-guide

Conversation

@lorerod

@lorerod lorerod commented Sep 4, 2025

Copy link
Copy Markdown
Contributor

Description

Add instructions on how to run specific tests.
Closes #1960

License

The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.

@lorerod
lorerod requested a review from dianabarsan September 4, 2025 21:22

@mrjones-plip mrjones-plip left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Lore! I know you didn't send this out for review yet, but just offering some early feedback.

Also - I think we were going to mention how to mention a way to not build all the docker images too maybe?

Comment on lines +61 to +79
```bash
# Run unit tests for admin module
npm run unit-admin

# Run unit tests for couchdb module
npm run unit-couchdb

# Run unit tests for API module
npm run unit-api

# Run unit tests for sentinel module
npm run unit-sentinel

# Run unit tests for shared-lib module
npm run unit-shared-lib

# Run unit tests for webapp module
npm run unit-webapp
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! I suggest instead of listing a bunch of examples of running an individual tests, I'd give and example to run just one. Then, list out how to find the rest. For example, for me, if type npm run unit and then hit the key to get autocomplete to fire and dynamically show all available:

$ npm run unit
unit                      unit-couchdb              unit-sentinel           
unit-admin                unit-haproxy              unit-shared-lib         
unit-api                  unit-haproxy-healthcheck  unit-webapp             
unit-cht-deploy           unit-nginx                unit-webapp-continuous  

```

#### Isolating specific tests within a module
To run only specific test suites or individual tests within a module, you can use `describe.only` or `it.only` in your test files.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you give a more specific example of exactly how to do this? Maybe deep link to a line number on a file and show the before and after?


```bash
# Run only the tests inside the pregnancy spec
npm run wdio-local -- --spec=pregnancy.wdio-spec.js

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should say wow to find a list of all e2e tests to run. I assume just specify the file name, but a deep link to the directory with all the files would be good.

alternately, walking the user down the sub directories in /tree/master/tests/e2e to find the specific pregnancy.wdio-spec.js could work instead. We could use the filetree feature maybe??

@dianabarsan dianabarsan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! I only left one comment about adding an example of how to run a specific wdio suite.

Comment thread content/en/community/contributing/code/core/automated-tests.md

@dianabarsan dianabarsan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!!

@lorerod
lorerod merged commit b38aa5f into main Sep 9, 2025
2 checks passed
@lorerod
lorerod deleted the 1960-test-specific-execution-guide branch September 9, 2025 12:17
mrjones-plip pushed a commit that referenced this pull request Sep 10, 2025
* add instructions for running specific tests

* implemented feedback
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.

Add instructions on how to run specific tests on the Automated Tests documentation

3 participants