Skip to content

Commit

Permalink
RF+ENH: add testing that step by step is identical to monolythic
Browse files Browse the repository at this point in the history
Ad-hoc -- use "shell" as interpreter for ``` whenever it should not become
part of the "step by step" script
  • Loading branch information
yarikoptic committed May 30, 2024
1 parent 890a1c5 commit 0be752d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ jobs:

- name: Test example in the README.md
run: bash <(sed -n -e '/^ *#!/,/^```$/p' README.md | grep -v '```')

- name: Test that the monolythic example is identical to the step by step
run: scripts/tests/test_README_versions
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ datalad install -d . -s ///repronim/containers code/containers
Now let's take a look at what we have.
```bash
```shell
/ds000003-qc # The root dataset contains everything
|--/sourcedata # we call it source, but it is actually ds000003-demo
|--/code/containers # repronim/containers, this is where our non-custom code lives
Expand Down Expand Up @@ -246,7 +246,7 @@ datalad run -m "Downgrade/Freeze mriqc container version" \
**Option 2: ///repronim/containers**
```bash
```shell
# Run from ~/my-experiments/ds000003-qc/containers
datalad run -m "Downgrade/Freeze mriqc container version" \
code/containers/scripts/freeze_versions bids-mriqc=0.16.0
Expand Down
3 changes: 3 additions & 0 deletions scripts/tests/test_README_versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

diff -Naur <(sed -n -e '/^ *#!/,/^```$/p' README.md | grep -v -E '^([()#]|PS4|cd .*mktemp|```)') <(sed -n -e '/Walkthrough/,/Do not change lines below/p' README.md | sed -n -e '/```bash/,/```/p' | grep -v -e '```' -e '~/my-experiments')

0 comments on commit 0be752d

Please sign in to comment.