From ea6b5c526259fb32b64a33b8f7670d4490ba46d6 Mon Sep 17 00:00:00 2001 From: "Gregory M. Kapfhammer" Date: Thu, 26 Oct 2023 11:16:16 -0400 Subject: [PATCH 1/9] fix: Correct incorrectly indented comment in the build.yml file. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bc076a47..2027b339 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,7 +71,7 @@ jobs: if: always() run: | poetry run task lint - # Run the program + # Run the program - name: Run program if: always() run: | From bd79fb5218cf1499d240f2775b76fd582bed96ce Mon Sep 17 00:00:00 2001 From: "Gregory M. Kapfhammer" Date: Thu, 26 Oct 2023 11:28:34 -0400 Subject: [PATCH 2/9] chore: Add an explanatory comment to the top of the build.yml file. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2027b339..bd5bf436 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,7 +16,7 @@ on: branches: [ master ] # Create one single job -# This job performs all necessary checks +# This job performs all of the necessary checks jobs: build: # Use the latest version of Ubuntu, MacOS, and Windows From 0faa226c4613af49cab91a9053b674ff336b4f41 Mon Sep 17 00:00:00 2001 From: "Gregory M. Kapfhammer" Date: Thu, 26 Oct 2023 11:31:11 -0400 Subject: [PATCH 3/9] chore: Add more explanatory comments to the build.yml file. --- .github/workflows/build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd5bf436..ccbae035 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,13 @@ jobs: build: # Use the latest version of Ubuntu, MacOS, and Windows # Use the latest and most stable version of Python + # Important: test coverage monitoring and reporting + # through a badge and the GitHub Actions job summary + # only takes place with the Linux operating system. + # Important: the MacOS and Windows operating systems + # have test coverage calculation take place but they + # do not report the test coverage beyond its display + # inside of the GitHub Actions panel for that job. runs-on: ${{ matrix.os }} strategy: fail-fast: false From 0a901927031d760d2300c3ca71ef9e1d04f37f61 Mon Sep 17 00:00:00 2001 From: "Gregory M. Kapfhammer" Date: Thu, 26 Oct 2023 11:59:18 -0400 Subject: [PATCH 4/9] chore: Modify the way that test coverage is calculated and reported in build.yml. --- .github/workflows/build.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ccbae035..b28ea4d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -88,13 +88,15 @@ jobs: if: always() run: | poetry run task test - # Run the test coverage monitoring - - name: Run Test Coverage - if: always() + # Run and collect the test coverage + # Important: only run and collect test coverage monitoring on Linux + - name: Run and Collect Test Coverage + if: always() && matrix.os == 'ubuntu-latest' run: | poetry run task test-coverage-silent > coverage.txt # Display the Coverage Report - - name: Display Coverage + # Important: only report the monitored test coverage on Linux + - name: Display Collected Test Coverage if: always() && matrix.os == 'ubuntu-latest' run: | export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])") @@ -102,3 +104,13 @@ jobs: echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY CURRENT_GITHUB_STEP_SUMMARY="\`\`\`\n$(cat coverage.txt)\n\`\`\`" echo "$CURRENT_GITHUB_STEP_SUMMARY" >> $GITHUB_STEP_SUMMARY + # Run and display the test coverage + # If the current operating system is not Linux, then only run test + # coverage monitoring and display it inside of the GitHub Actions + # panel. This allows for test coverage to be calculated for each + # operating system. However, coverage is only reported for Linux + # through the badge and through the GitHub job summary. + - name: Run and Report Test Coverage + if: always() && matrix.os != 'ubuntu-latest' + run: | + poetry run task test-coverage From 4e574fbeefb400b2e99d7d5122fcd9e6e9e9f344 Mon Sep 17 00:00:00 2001 From: "Gregory M. Kapfhammer" Date: Thu, 26 Oct 2023 12:04:51 -0400 Subject: [PATCH 5/9] chore: Improve the names of tasks in the build.yml file. --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b28ea4d0..62f607be 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -90,13 +90,13 @@ jobs: poetry run task test # Run and collect the test coverage # Important: only run and collect test coverage monitoring on Linux - - name: Run and Collect Test Coverage + - name: Run and Collect Test Coverage - Linux Only if: always() && matrix.os == 'ubuntu-latest' run: | poetry run task test-coverage-silent > coverage.txt # Display the Coverage Report # Important: only report the monitored test coverage on Linux - - name: Display Collected Test Coverage + - name: Display Collected Test Coverage - Linux Only if: always() && matrix.os == 'ubuntu-latest' run: | export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])") @@ -110,7 +110,7 @@ jobs: # panel. This allows for test coverage to be calculated for each # operating system. However, coverage is only reported for Linux # through the badge and through the GitHub job summary. - - name: Run and Report Test Coverage + - name: Run and Report Test Coverage - MacOS and Windows Only if: always() && matrix.os != 'ubuntu-latest' run: | poetry run task test-coverage From 0a7835d32d4a5c6938fafd7d302f6c8d3f6c9da2 Mon Sep 17 00:00:00 2001 From: "Gregory M. Kapfhammer" Date: Tue, 31 Oct 2023 10:13:47 -0400 Subject: [PATCH 6/9] fix: Remove the calculation of test coverage on Windows and MacOS in build.yml. --- .github/workflows/build.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62f607be..61bc194f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -104,13 +104,3 @@ jobs: echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY CURRENT_GITHUB_STEP_SUMMARY="\`\`\`\n$(cat coverage.txt)\n\`\`\`" echo "$CURRENT_GITHUB_STEP_SUMMARY" >> $GITHUB_STEP_SUMMARY - # Run and display the test coverage - # If the current operating system is not Linux, then only run test - # coverage monitoring and display it inside of the GitHub Actions - # panel. This allows for test coverage to be calculated for each - # operating system. However, coverage is only reported for Linux - # through the badge and through the GitHub job summary. - - name: Run and Report Test Coverage - MacOS and Windows Only - if: always() && matrix.os != 'ubuntu-latest' - run: | - poetry run task test-coverage From c47578a5bba759aabb58a4f127622ed4c035d541 Mon Sep 17 00:00:00 2001 From: "Gregory M. Kapfhammer" Date: Tue, 31 Oct 2023 10:15:07 -0400 Subject: [PATCH 7/9] chore: Add the use of test coverage on macOS in the build.yml file. --- .github/workflows/build.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 61bc194f..be41b5de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -104,3 +104,13 @@ jobs: echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY CURRENT_GITHUB_STEP_SUMMARY="\`\`\`\n$(cat coverage.txt)\n\`\`\`" echo "$CURRENT_GITHUB_STEP_SUMMARY" >> $GITHUB_STEP_SUMMARY + # Run and display the test coverage + # If the current operating system is not Linux, then only run test + # coverage monitoring and display it inside of the GitHub Actions + # panel. This allows for test coverage to be calculated for each + # operating system. However, coverage is only reported for Linux + # through the badge and through the GitHub job summary. + - name: Run and Report Test Coverage - MacOS and Windows Only + if: always() && matrix.os == 'macOS' + run: | + poetry run task test-coverage From 7ce8141a61d41b07ce9dbc13698439d9c426cdbb Mon Sep 17 00:00:00 2001 From: "Gregory M. Kapfhammer" Date: Tue, 31 Oct 2023 10:23:18 -0400 Subject: [PATCH 8/9] chore: Update comments and labels in the build.yml file. --- .github/workflows/build.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be41b5de..f2dbb169 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -105,12 +105,14 @@ jobs: CURRENT_GITHUB_STEP_SUMMARY="\`\`\`\n$(cat coverage.txt)\n\`\`\`" echo "$CURRENT_GITHUB_STEP_SUMMARY" >> $GITHUB_STEP_SUMMARY # Run and display the test coverage - # If the current operating system is not Linux, then only run test + # If the current operating system is MacOS, then only run test # coverage monitoring and display it inside of the GitHub Actions # panel. This allows for test coverage to be calculated for each # operating system. However, coverage is only reported for Linux - # through the badge and through the GitHub job summary. - - name: Run and Report Test Coverage - MacOS and Windows Only + # through the badge and through the GitHub job summary. Do not + # run any test coverage monitoring in Windows because it seems + # to be much slower and cause hypothesis-based tests to fail. + - name: Run and Report Test Coverage - MacOS Only if: always() && matrix.os == 'macOS' run: | poetry run task test-coverage From 05a77b24e6b66f0a9dec81e28cb964f2e77adb04 Mon Sep 17 00:00:00 2001 From: "Gregory M. Kapfhammer" Date: Tue, 31 Oct 2023 14:04:23 -0400 Subject: [PATCH 9/9] fix: Add a HealthCheck setting for an Hypothesis test in test_validate.py. --- tests/test_validate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_validate.py b/tests/test_validate.py index dda4fe1d..87845f23 100644 --- a/tests/test_validate.py +++ b/tests/test_validate.py @@ -1,7 +1,7 @@ """Pytest test suite for the validate module.""" import pytest -from hypothesis import given, strategies +from hypothesis import HealthCheck, given, settings, strategies from hypothesis_jsonschema import from_schema from chasten.validate import JSON_SCHEMA_CONFIG, validate_configuration @@ -44,6 +44,7 @@ def test_validate_empty_config(config): @given(from_schema(JSON_SCHEMA_CONFIG)) +@settings(suppress_health_check=[HealthCheck.too_slow]) @pytest.mark.fuzz def test_integers(config): """Use Hypothesis and the JSON schema plugin to confirm validation works for all possible valid instances."""