Skip to content

Commit

Permalink
Document new test_command options (#789)
Browse files Browse the repository at this point in the history
Document new test_command options

Documentation for packit/packit-service#2270
Related to packit/packit#2056

Reviewed-by: Nikola Forró
Reviewed-by: Laura Barcziová
  • Loading branch information
softwarefactory-project-zuul[bot] authored Dec 12, 2023
2 parents 5b71781 + cab2212 commit df145d7
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
33 changes: 33 additions & 0 deletions docs/configuration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,39 @@ The value requires a Python regex pattern and is used with `re.match` function.
matched values are not the same, thus Packit will not create a *3.9.0* pull request release on dist-git target
branch. If there is an *3.8.1* release, the matched values (=`3.8`) are the same and pull request is created.


#### test_command
##### default_identifier
The identifier (refer to [`identifier`](./configuration/upstream/tests#optional-parameters)) utilised by default when
the `/packit test` comment command is invoked without arguments
(see [related docs](./configuration/upstream/tests#running-tests-with-a-specific-identifier)).
This allows commonly used job to be triggered without the need for manual specification.
For instance, rather than specifying frequently used job via `--identifier` each time, such as `/packit test --identfier my-id`,
you can configure the following:

```yaml
default_identifier: my-id
```
As a result, invoking `/packit test` will be automatically interpreted as `/packit test --identfier my-id`.

##### default_labels
A list of labels (refer to [`labels`](./configuration/upstream/tests#optional-parameters)) utilised by default when
the `/packit test` comment command is invoked without arguments
(see [related docs](./configuration/upstream/tests#running-a-group-of-tests-with-the-same-label)).
This allows commonly used job combinations to be triggered without the need for manual specification.
For instance, rather than specifying frequently used jobs via `--labels` each time, such as `/packit test --labels regression,upgrade`,
you can configure the following:
```yaml
default_labels:
- regression
- upgrade
```
As a result, invoking `/packit test` will be automatically interpreted as `/packit test --labels regression,upgrade`.

:::info
`default_identifier` and `default_labels` are not supposed to be used simultaneously. You should configure
only one of these options.
:::
## Aliases

To not need to change the config file when the new system version is released,
Expand Down
6 changes: 5 additions & 1 deletion docs/configuration/upstream/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,16 @@ Please reach out back to us for help or with your suggestions.
## Running tests with a specific identifier
It is possible to run a specific job via `/packit test` command.
The user just needs to specify the argument `--identifier <job_identifier>` and Packit will trigger only the job with this identifier.
The whole command should look like this: `/packit test --identifier my-job-id`
The whole command should look like this: `/packit test --identifier my-job-id`.
You can also configure [`test_command.default_identifier`](/docs/configuration#default_identifier) to allow commonly used jobs
to be triggered without the need for manual specification.

## Running a group of tests with the same label
Users can trigger a specific group of jobs that has a specific value in the list of `labels` option.
The command to pick up these jobs is `/packit test --labels regression,upgrade` where either `regression` or `upgrade` must be present in `labels` option for the job.
The labels should be in the format of comma-separated string.
You can also configure [`test_command.default_labels`](/docs/configuration#default_labels) to allow commonly used job combinations
to be triggered without the need for manual specification.

## Creating Tests

Expand Down

0 comments on commit df145d7

Please sign in to comment.