Cspell uses integration tests to verify that changes to the tools, libraries, and dictionaries did not break existing / expected behavior.
- The Integration Test makes a local copy of the repository to be tested
- The cspell tool is run against the local copy
- The result is compared against a snapshot
- Historical - against a fixed commit of a repository, the integration is used to track improvements to cspell over time.
- Active - targets repositories that actively use cspell to address spelling issues, the integration is used to verify
cspell works as expected against the repository.
Checking against
main
should be possible
Currently, only Historical tests are supported. Active tests are possible, but would need changes to the testing tool.
Repositories are choose to be representative of public domain code bases and programming languages.
- Must be in the public domain
- Must support Git
- Should match some of the following:
- Primarily contains files that cspell supports or will support
- Currently uses cspell (this is a nice to have but not a requirement)
- Contains a lot of false positives (we want to get that number down over time)
- Can be checked in a reasonable amount of time.
- Add the repository:
./tester.js add https://github.com/<owner>/<repository>.git -t $(gh auth token)
- Adjust the arguments in:
config/config.json
- Create a snapshot:
./tester.js check -u <owner/repository>
- Verify the snapshot:
snapshots/owner/repository/snapshot.txt
Contains the normalized output of the cspell command. - Run the tester against the snapshot:
./tester.js check <owner/repository>
- When read, add it to the matrix in:
/.github/workflows/integration-test.yml
The tester will make a local copy of the repository in repositories/<owner>/<repository>
and add the
repository to config/config.json
.
As cspell improves, the results of the snapshot will change over time. This is especially true for false positives. Dictionary and parsing improvements should cause incremental changes to the snapshot.
To fix a broken snapshot:
./tester.js check -u <owner/repository>
To regenerate ALL snapshots (this can take a LOT of time):
./tester.js check -u