From efd7e16d36c545ffaa8af6720ac64157a0cc5201 Mon Sep 17 00:00:00 2001 From: Karen Fang Date: Thu, 1 Jun 2023 15:38:09 -0400 Subject: [PATCH 1/2] Add xml_validator test for IsoSeq --- src/wdlci/wdl_tests/count_columns.wdl | 5 +-- src/wdlci/wdl_tests/xml_validator.wdl | 47 +++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 src/wdlci/wdl_tests/xml_validator.wdl diff --git a/src/wdlci/wdl_tests/count_columns.wdl b/src/wdlci/wdl_tests/count_columns.wdl index b160b2c..e2a033c 100644 --- a/src/wdlci/wdl_tests/count_columns.wdl +++ b/src/wdlci/wdl_tests/count_columns.wdl @@ -26,8 +26,9 @@ task count_columns { current_run_output_column_count=$(sed 's;,;\t;g' ~{current_run_output} | awk '{print NF}' | sort -nu | tail -n 1) validated_output_column_count=$(sed 's;,;\t;g' ~{validated_output} | awk '{print NF}' | sort -nu | tail -n 1) else - current_run_output_column_count=$(awk '{print NF}' ~{current_run_output} | sort -nu | tail -n 1) - validated_output_column_count=$(awk '{print NF}' ~{validated_output} | sort -nu | tail -n 1) + # Disregard headers starting with `#` + current_run_output_column_count=$(sed '/^#/d' ~{current_run_output} | awk '{print NF}' | sort -nu | tail -n 1) + validated_output_column_count=$(sed '/^#/d' ~{validated_output} | awk '{print NF}' | sort -nu | tail -n 1) fi if [[ "$current_run_output_column_count" != "$validated_output_column_count" ]]; then diff --git a/src/wdlci/wdl_tests/xml_validator.wdl b/src/wdlci/wdl_tests/xml_validator.wdl new file mode 100644 index 0000000..225a688 --- /dev/null +++ b/src/wdlci/wdl_tests/xml_validator.wdl @@ -0,0 +1,47 @@ +version 1.0 + +# Parse and validate XML file +# Input type: XML files + +task xml_validator { + input { + File current_run_output + File validated_output + } + + Int disk_size = ceil(size(current_run_output, "GB") + size(validated_output, "GB") + 50) + + command <<< + set -euo pipefail + + err() { + message=$1 + + echo -e "[ERROR] $message" >&2 + } + + if ! xmllint --noout ~{validated_output}; then + err "Validated XML file: [~{basename(validated_output)}] is invalid" + exit 1 + else + if ! xmllint --noout ~{current_run_output}; then + err "Current run XML file: [~{basename(current_run_output)}] is invalid" + exit 1 + else + echo "Current run XML file: [~{basename(current_run_output)}] is valid" + fi + fi + >>> + + output { + } + + runtime { + docker: "dnastack/dnastack-wdl-ci-tools:0.0.1" + cpu: 1 + memory: "3.75 GB" + disk: disk_size + " GB" + disks: "local-disk " + disk_size + " HDD" + preemptible: 1 + } +} From 4e2e314d4036af75c8f54a2a5bd2c8060aed11ac Mon Sep 17 00:00:00 2001 From: Heather Ward Date: Mon, 5 Jun 2023 12:27:06 -0400 Subject: [PATCH 2/2] Bump version --- README.md | 8 ++++---- action.yml | 10 +++++----- pyproject.toml | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 4303e68..89576fa 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ If any step of the action fails, the check will fail; however if some task tests # GitHub action usage ```yaml -- uses: dnastack/wdl-ci@v0.1.7 +- uses: dnastack/wdl-ci@v0.1.8 with: # Configuration file where tests can be found # Default: wdl-ci.config.json @@ -86,7 +86,7 @@ jobs: with: submodules: true - name: wdl-ci - uses: dnastack/wdl-ci@v0.1.7 + uses: dnastack/wdl-ci@v0.1.8 with: wallet-url: ${{ secrets.WALLET_URL }} wallet-client-id: ${{ secrets.WALLET_CLIENT_ID }} @@ -114,7 +114,7 @@ jobs: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} - name: wdl-ci - uses: dnastack/wdl-ci@v0.1.7 + uses: dnastack/wdl-ci@v0.1.8 with: wallet-url: ${{ secrets.WALLET_URL }} wallet-client-id: ${{ secrets.WALLET_CLIENT_ID }} @@ -144,7 +144,7 @@ jobs: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} - name: wdl-ci - uses: dnastack/wdl-ci@v0.1.7 + uses: dnastack/wdl-ci@v0.1.8 with: wallet-url: ${{ secrets.WALLET_URL }} wallet-client-id: ${{ secrets.WALLET_CLIENT_ID }} diff --git a/action.yml b/action.yml index 611808a..b9a7008 100644 --- a/action.yml +++ b/action.yml @@ -50,19 +50,19 @@ runs: echo "WDL_CI_CUSTOM_TEST_WDL_DIR"=${{ inputs.wdl_ci_custom_test_wdl_dir }} >> $GITHUB_ENV fi - name: lint - uses: docker://dnastack/wdl-ci:v0.1.7 + uses: docker://dnastack/wdl-ci:v0.1.8 with: args: lint - name: detect-changes - uses: docker://dnastack/wdl-ci:v0.1.7 + uses: docker://dnastack/wdl-ci:v0.1.8 with: args: detect-changes - name: submit - uses: docker://dnastack/wdl-ci:v0.1.7 + uses: docker://dnastack/wdl-ci:v0.1.8 with: args: submit - name: monitor - uses: docker://dnastack/wdl-ci:v0.1.7 + uses: docker://dnastack/wdl-ci:v0.1.8 with: args: monitor --update-digests # If a test fails, still update task digests for any tests that succeeded @@ -76,6 +76,6 @@ runs: default_author: github_actions - name: cleanup if: always() - uses: docker://dnastack/wdl-ci:v0.1.7 + uses: docker://dnastack/wdl-ci:v0.1.8 with: args: cleanup diff --git a/pyproject.toml b/pyproject.toml index b3c9ed5..a35db06 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "wdl-testing-cli" description = "DNAstack WDL testing CLI" -version = "v0.1.7" +version = "v0.1.8" authors = [ { name = "DNAstack", email = "devs@dnastack.com" } ]