Skip to content

Commit

Permalink
tests: explain in CODING.md the spread tests enforced rules (canonica…
Browse files Browse the repository at this point in the history
…l#13396)

* tests: explain in CODING.md the spread tests coding rules

This change in including the required sections and order that all the
spread tests have to follow in snapd. Also it is mentioned that the CI
tooling is enforcing that.

* new wording and ordered list
  • Loading branch information
sergiocazzolato authored Nov 30, 2023
1 parent b7383cf commit ab95c36
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions CODING.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,25 @@ We do not have strong policies against repetition in test code, as usual the imp

We write them using [spread](https://github.com/snapcore/spread). Generally all externally visible features and behaviour should have spread tests. It's also important to have them for robustness and fallback behaviour as related to system properties.

In order to keep the integration testing harness easy to read and consistent, there are some rules about the order and the existence of the different spread tests sections.

This is the ordered sections list to follow:
1. summary (required)
1. details (required)
1. backends
1. systems
1. manual
1. priority
1. warn-timeout
1. kill-timeout
1. environment
1. prepare
1. restore
1. debug
1. execute (required)

The CI tooling will check and enforce the order and required sections when a spread test is created or updated.

## PRs and refactorings

* PR should ideally have diffs of around 500 lines or less. There might be exceptions when size is due to large repetitive tests, but not for the production code. Experience indicates that smaller PRs are easier to review, while it is hard to do careful and punctual reviews for very large diffs.
Expand Down

0 comments on commit ab95c36

Please sign in to comment.