-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Metaschema XSLT Inspector (#73) Several months of work building InspectorXSLT using test-driven-development. Also includes considerable work on XSpec support including XProc and Saxon runtimes, scripts and CI/CD support. --------- Co-authored-by: A.J. Stein <[email protected]> * Update XSPEC-BATCH.xsl On-the-fly modification of JUnit XML results * Adjustments to XSpec reporting under CI (#99) * Fine adjustments in prep for 'nearly good enough' XSpec support under ci/cd (in feature branch) * Adjustments for legibility * Another touchup * Buffs in view of CI/CD and local/CL use cases for testing under make including new error-on-fail option * Added to script documentation * Still polishing help msg * Now with some more nicer XProc and scripting supporting ongoing maintenance / dev * adjustments to test runtime * Further refinements to testing & scripts * Rationalizing including file name regularization * Further configuration enhancements * More help in docs * Further testing/tuning/tweaking test runtimes and docs * Further alignment * New 'quiet' XSpec batching script, plus adjustment * New 'make' feature for testing InspectorXSLT * More Makefile edits / cleanup * Further docs and readme improvements * Removed obsolete Schematron implementation, no longer of interest * More polishing * Further small but useful improvements and cleanup * Added another utility script * Continuing to touch up * Add permissions for EnricoMi/publish-unit-test-result-action Using the guidance from the action's instructions: https://github.com/EnricoMi/publish-unit-test-result-action?tab=readme-ov-file#support-fork-repositories-and-dependabot-branches * Add artifact event pull for EnricoMi/publish-unit-test-result-action Using the guidance from the action's instructions: https://github.com/EnricoMi/publish-unit-test-result-action?tab=readme-ov-file#support-fork-repositories-and-dependabot-branches * Ensure XSpec test results comment always made on PR * [WIP] Dedupe event trigger and inline JUnit XML processing in CI workflow --------- Co-authored-by: A.J. Stein <[email protected]> --------- Co-authored-by: A.J. Stein <[email protected]>
- Loading branch information
1 parent
2515000
commit 0010340
Showing
89 changed files
with
11,521 additions
and
880 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Rationale and instructions for this GitHub Actions workflow: | ||
# https://github.com/EnricoMi/publish-unit-test-result-action?tab=readme-ov-file#support-fork-repositories-and-dependabot-branches | ||
|
||
name: Publish Test Results | ||
on: | ||
workflow_run: | ||
workflows: ["CI"] | ||
types: | ||
- completed | ||
permissions: {} | ||
jobs: | ||
test-results: | ||
name: Test Results | ||
runs-on: ubuntu-latest | ||
if: github.event.workflow_run.conclusion != 'skipped' | ||
permissions: | ||
checks: write | ||
pull-requests: write | ||
actions: read | ||
steps: | ||
- name: Download and Extract Artifacts | ||
uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615 | ||
with: | ||
run_id: ${{ github.event.workflow_run.id }} | ||
path: artifacts | ||
- name: Publish Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@8885e273a4343cd7b48eaa72428dea0c3067ea98 | ||
with: | ||
commit: ${{ github.event.workflow_run.head_sha }} | ||
action_fail: true | ||
fail_on: "test failures" | ||
event_file: artifacts/Test Results Event/event.json | ||
event_name: ${{ github.event.workflow_run.event }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
check_name: XSpec Test Results | ||
comment_mode: always | ||
files: "**/*_junit-report.xml" | ||
report_individual_runs: true | ||
deduplicate_classes_by_file_name: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: {} | ||
permissions: | ||
checks: write | ||
pull-requests: write | ||
env: | ||
JAVA_VERSION: "17" | ||
JAVA_DISTRIBUTION: "temurin" | ||
jobs: | ||
test: | ||
name: "Test and Collect Results" | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: "${{ env.JAVA_DISTRIBUTION }}" | ||
java-version: "${{ env.JAVA_VERSION }}" | ||
- name: Run unit tests | ||
run: | | ||
make -C src unit-test | ||
id: unit-tests | ||
- name: Run integration tests | ||
run: | | ||
make -C src smoke-test | ||
id: integration-tests | ||
- name: Run specification tests | ||
run: | | ||
make -C src spec-test | ||
id: spec-tests | ||
- name: Upload test results | ||
if: always() | ||
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 | ||
with: | ||
name: Test Results | ||
path: | | ||
**/*_junit-report.xml | ||
event_file: | ||
name: "Upload Results to Event File" | ||
runs-on: ubuntu-20.04 | ||
needs: test | ||
steps: | ||
- name: Upload | ||
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 | ||
with: | ||
name: Test Results Event | ||
path: ${{ github.event_path }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
include ../../testing/make_common.mk | ||
|
||
# INCLUDES: | ||
# unit-test - unit testing - XSLT production templates for InspectorXSLT | ||
# smoke-test - smoke testing - whether an XSLT is produced and compiles in a run | ||
# spec-test - specification conformance testing - functional runtime tests of the generated XSLT | ||
# refresh-testing - update InspectorXSLT and XSD for test metaschemas | ||
# xspec - run XSpec tests in designated folder | ||
# clean - clean up designated output folder | ||
|
||
module_path:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) | ||
output_folder:=$(module_path)/test_output | ||
xspec_script=$(realpath $(module_path)/../../../support/xspec-dev/mvn-saxon-xspec-batch-quiet.sh) | ||
xspec_ci_script=$(realpath $(module_path)/../../../support/xspec-dev/mvn-saxon-xspec-batch.sh) | ||
smoketest_script=$(realpath $(module_path)/testing/smoketest-computer-inspector.sh) | ||
testing-refresh_script=$(realpath $(module_path)/testing/refresh-test-inspectors.sh) | ||
folder=. | ||
|
||
.PHONY: test | ||
test: smoke-test unit-test spec-test ## Run all tests | ||
|
||
|
||
.PHONY: spec-test | ||
spec-test: ## Run all specification tests | ||
LOGFILE="$(output_folder)/inspector-functional-tests.log" $(xspec_ci_script) \ | ||
"folder=$(module_path)/testing/tests/inspector-functional-xspec" \ | ||
"report-to=$(output_folder)/inspector-functional-tests_report.html" \ | ||
"junit-to=$(output_folder)/inspector-functional-tests_junit-report.xml" \ | ||
"stop-on-error=yes" \ | ||
"recurse=yes" | ||
|
||
.PHONY: unit-test | ||
unit-test: ## Run all unit tests | ||
LOGFILE="$(output_folder)/inspector-generation-tests.log" $(xspec_ci_script) \ | ||
"folder=$(module_path)/testing/tests/inspector-generation-xspec" \ | ||
"report-to=$(output_folder)/inspector-generation_report.html" \ | ||
"junit-to=$(output_folder)/inspector-generation_junit-report.xml" \ | ||
"stop-on-error=yes" \ | ||
"recurse=yes" | ||
|
||
|
||
.PHONY: smoke-test | ||
smoke-test: ## Run InspectorXSLT production smoke test | ||
$(smoketest_script) | ||
|
||
|
||
.PHONY: refresh-testing | ||
refresh-testing: ## Update InspectorXSLT and XSD for test metaschemas (doesn't run tests) | ||
$(testing-refresh_script) | ||
|
||
|
||
.PHONY: xspec | ||
xspec: ## Run all *.xspec in a designated folder, quietly - use folder=[folder] | ||
LOGFILE="$(output_folder)/$(folder)-xspec-tests.log" $(xspec_script) \ | ||
"baseURI=file:$(module_path)/" \ | ||
"folder=$(folder)" \ | ||
"report-to=$(output_folder)/inspector-$(folder)-tests_report.html" \ | ||
"stop-on-error=no" \ | ||
"recurse=yes" | ||
|
||
|
||
.PHONY: clean | ||
clean: ## Remove test output | ||
rm -fr $(output_folder)/* |
Oops, something went wrong.