Skip to content

Commit

Permalink
Added some basic tests, more work to be done and preparing a bug fix …
Browse files Browse the repository at this point in the history
…release
  • Loading branch information
jonasbn committed Oct 17, 2024
1 parent 7d3537e commit a2bc6f1
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log for spellcheck-github-actions

## 0.43.1, 2024-10-17, bug fix release, update recommended

- This is an attempt at addressing the conflict between using the PySpelling `--source` parameter and the `sources` parameter in the PySpelling configuration file introduced by this action. With the recommendation of using the GitHub Action: [tj-actions/changed-files](https:/marketplace/actions/changed-files), the use of the `--source` flag was adopted, but this bypasses the filtering mechanism, which can be enabled in the configuration file. The update recommendation is due to the fact that you might experience unwanted behaviour if your `sources` contain negated file patterns. The patch enables application of the configured filter to the source parameters, so the action can be used with the `--source` parameter and the `sources` configuration parameter in combination.

- Issue [#213](https:/rojopolis/spellcheck-github-actions/issues/213)

## 0.43.0, 2024-10-08, maintenance release, update not required

- Docker image updated to Python 3.12.7 slim via PR [#215](https:/rojopolis/spellcheck-github-actions/pull/215) from Dependabot. [Release notes for Python 3.12.7](https://docs.python.org/release/3.12.7/whatsnew/changelog.html)
Expand Down
41 changes: 41 additions & 0 deletions test/test.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@test "can do basic run using Docker image with two input files" {
docker run -e INPUT_SOURCE_FILES="README.md CHANGELOG.md" \
-e INPUT_TASK_NAME=Markdown -it -v $PWD:/tmp \
jonasbn/github-action-spellcheck:local
}

@test "can do basic run using Docker image with unignored and ignored input files" {
docker run -e INPUT_SOURCE_FILES="README.md venv/lib/python3.13/site-packages/pyspelling-2.10.dist-info/licenses/LICENSE.md" \
-e INPUT_TASK_NAME=Markdown -it -v $PWD:/tmp \
jonasbn/github-action-spellcheck:local
}

@test "can do basic run using Docker image with just ignored input file" {
docker run -e INPUT_SOURCE_FILES="venv/lib/python3.13/site-packages/pyspelling-2.10.dist-info/licenses/LICENSE.md" \
-e INPUT_TASK_NAME=Markdown -it -v $PWD:/tmp \
jonasbn/github-action-spellcheck:local
}

@test "can do basic run using Docker image without any input files" {
docker run \
-e INPUT_TASK_NAME=Markdown -it -v $PWD:/tmp \
jonasbn/github-action-spellcheck:local
}

@test "can do basic run using Docker image without task parameter" {
docker run \
-it -v $PWD:/tmp \
jonasbn/github-action-spellcheck:local
}

@test "can do basic run using Docker image with two input files but not task parameter" {
! docker run -e INPUT_SOURCE_FILES="README.md CHANGELOG.md" \
-it -v $PWD:/tmp \
jonasbn/github-action-spellcheck:local
}

@test "can do basic run using Docker image with two non-existing input files" {
! docker run -e INPUT_SOURCE_FILES="DONOTREADME.md LOGCHANGE.md" \
-e INPUT_TASK_NAME=Markdown -it -v $PWD:/tmp \
jonasbn/github-action-spellcheck:local
}

0 comments on commit a2bc6f1

Please sign in to comment.