Skip to content

Commit

Permalink
Patch main-ci workflow (#434)
Browse files Browse the repository at this point in the history
* Bump schematic testing to 24.4.1

* Refine workflow build commit step

* Update test

* Rebuild NF.jsonld, json

* Use v4 to resolve deprecation notice

* Add another control test manifest

* Update test config with new mock manifest

* Remove restriction GE rules

* Update the new control manifest

---------

Co-authored-by: nf-osi[bot] <[email protected]>
  • Loading branch information
anngvu and nfosi-service authored May 3, 2024
1 parent 92c8cbc commit 9985494
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 13 deletions.
29 changes: 18 additions & 11 deletions .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
branches: [main]
paths:
- 'modules/**'
- '.github/workflows/main-ci.yml'

workflow_dispatch:

Expand Down Expand Up @@ -37,12 +38,18 @@ jobs:
make PortalDataset
make PortalStudy
- name: Commit files
- name: Commit files if there are changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "nf-osi[bot]"
git add .
git commit -m "Rebuild NF.jsonld, json"
if [[ $(git diff --exit-code) ]]; then
echo "Changes in src modules affect final jsonld or json artifacts and will be committed"
git config --local user.email "[email protected]"
git config --local user.name "nf-osi[bot]"
git add .
git commit -m "Rebuild NF.jsonld, json"
else
echo "Changes in src modules did not affect final jsonld or json artifacts"
echo "Note that tests will still be run in the next job"
fi
- name: Push changes
uses: ad-m/github-push-action@master
Expand All @@ -53,7 +60,7 @@ jobs:

# Additionally test PRs
test:
name: Test with schematic
name: Test with schematic current version
needs: [build]
runs-on: ubuntu-latest
env:
Expand All @@ -62,7 +69,7 @@ jobs:
pull-requests: write
strategy:
matrix:
schematic-version: [24.2.1]
schematic-version: [24.4.1] # cannot actually do parallel/concurrent testing and need to do sequential because of API rate limits

steps:
- uses: actions/checkout@v4
Expand All @@ -80,7 +87,7 @@ jobs:

- name: Sanity-check successful installation and version
run: pip show schematicpy

- name: Test generate
working-directory: tests/generate
continue-on-error: true
Expand All @@ -96,17 +103,17 @@ jobs:
- name: Create test suite report
working-directory: tests
continue-on-error: true
run: docker run -v $(pwd):/tests rocker/tidyverse R -e "rmarkdown::render('tests/test-suite-report.Rmd')"
run: docker run -v $(pwd):/tests -e SCHEMATIC=${{ matrix.schematic-version }} rocker/tidyverse R -e "rmarkdown::render('tests/test-suite-report.Rmd')"

- name: Report on test suite as PR comment
uses: mshick/add-pr-comment@v2
with:
message-id: test-suite-report
message-id: test-suite-report-${{ matrix.schematic-version }}
message-path: |
tests/test-suite-report.md
- name: Upload test artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test-logs-${{ matrix.schematic-version }}
path: tests/**/logs
Expand Down
2 changes: 1 addition & 1 deletion tests/test-suite-report.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Test Suite Report"
title: "Test Suite Report `r Sys.getenv('SCHEMATIC')`"
output:
github_document:
html_preview: false
Expand Down
5 changes: 5 additions & 0 deletions tests/validate/GenomicsAssayTemplate_control.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Component,Filename,fileFormat,resourceType,dataType,dataSubtype,assay,individualID,species,sex,age,ageUnit,diagnosis,nf1Genotype,nf2Genotype,modelSystemName,parentSpecimenID,specimenID,aliquotID,tumorType,platform,nucleicAcidSource,specimenPreparationMethod,specimenType,runType,libraryStrand,libraryPrep,libraryPreparationMethod,readPair,readLength,readDepth,targetDepth,batchID
GenomicsAssayTemplate,a,fastq,experimentalData,geneExpression,raw,RNA-seq,A,Homo sapiens,Female,20,years,Neurofibromatosis type 1,,,JHU 2-079-CL,,A1,,Not Applicable,Illumina NovaSeq 6000,,RNAlater,,pairedEnd,FirstStranded,,TruSeq standard total RNA library kit,,150,,,
GenomicsAssayTemplate,b,fastq,experimentalData,geneExpression,raw,RNA-seq,B,Homo sapiens,Female,20,years,Neurofibromatosis type 1,,,JHU 2-079-CL,,B2,,Not Applicable,Illumina NovaSeq 6000,,RNAlater,,pairedEnd,FirstStranded,,TruSeq standard total RNA library kit,,150,,,
GenomicsAssayTemplate,c,fastq,experimentalData,geneExpression,raw,RNA-seq,C,Homo sapiens,Female,20,years,Neurofibromatosis type 1,,,JHU 2-079-CL,,C3,,Not Applicable,Illumina NovaSeq 6000,,RNAlater,,pairedEnd,FirstStranded,,TruSeq standard total RNA library kit,,150,,,
GenomicsAssayTemplate,d,fastq,experimentalData,geneExpression,raw,RNA-seq,D,Homo sapiens,Female,20,years,Neurofibromatosis type 1,,,JHU 2-079-CL,,D4,,Not Applicable,Illumina NovaSeq 6000,,RNAlater,,pairedEnd,FirstStranded,,TruSeq standard total RNA library kit,,150,,,
8 changes: 8 additions & 0 deletions tests/validate/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
}
},
"tests": [
{
"manifest": "GenomicsAssayTemplate_control.csv",
"template": "GenomicsAssayTemplate",
"expect_pass": true,
"expectation": "There should be no issue with this template.",
"comment": "Optional attributes are filled (sometimes nonsensically just to make sure there's something), in contrast with templates 0-2.",
"issue": ["https://github.com/Sage-Bionetworks/schematic/issues/819"]
},
{
"manifest": "GenomicsAssayTemplate_0.csv",
"template": "GenomicsAssayTemplate",
Expand Down
2 changes: 1 addition & 1 deletion tests/validate/run_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ for i in ${!MANIFESTS[@]}
do
echo ">>>>>>> Testing ${MANIFESTS[$i]} "
schematic model --config config.yml \
validate -mp ${MANIFESTS[$i]} -dt ${TEMPLATES[$i]} -rr 2>&1 | tee $LOG_DIR/${MANIFESTS[$i]%.*}.txt
validate -mp ${MANIFESTS[$i]} -dt ${TEMPLATES[$i]} 2>&1 | tee $LOG_DIR/${MANIFESTS[$i]%.*}.txt
done

echo "Cleaning up test fixtures and intermediates..."
Expand Down

0 comments on commit 9985494

Please sign in to comment.