Skip to content

Commit

Permalink
Merge pull request #29 from DNAstack/isoseq-tests
Browse files Browse the repository at this point in the history
Add xml_validator test for IsoSeq
  • Loading branch information
hkeward authored Jun 5, 2023
2 parents 1bce446 + 4e2e314 commit bccdcf4
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 12 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected].7
- uses: dnastack/[email protected].8
with:
# Configuration file where tests can be found
# Default: wdl-ci.config.json
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
with:
submodules: true
- name: wdl-ci
uses: dnastack/[email protected].7
uses: dnastack/[email protected].8
with:
wallet-url: ${{ secrets.WALLET_URL }}
wallet-client-id: ${{ secrets.WALLET_CLIENT_ID }}
Expand Down Expand Up @@ -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/[email protected].7
uses: dnastack/[email protected].8
with:
wallet-url: ${{ secrets.WALLET_URL }}
wallet-client-id: ${{ secrets.WALLET_CLIENT_ID }}
Expand Down Expand Up @@ -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/[email protected].7
uses: dnastack/[email protected].8
with:
wallet-url: ${{ secrets.WALLET_URL }}
wallet-client-id: ${{ secrets.WALLET_CLIENT_ID }}
Expand Down
10 changes: 5 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]" }
]
Expand Down
5 changes: 3 additions & 2 deletions src/wdlci/wdl_tests/count_columns.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
47 changes: 47 additions & 0 deletions src/wdlci/wdl_tests/xml_validator.wdl
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit bccdcf4

Please sign in to comment.