asreview / asreview-makita

Workflow generator for simulation studies using the command line interface of ASReview LAB
https://asreview.ai
MIT License
30 stars 17 forks source link

Update ci-workflow #31

Closed jteijema closed 1 year ago

jteijema commented 1 year ago

This PR adds tests to verify the correct functioning of makita.

jteijema commented 1 year ago

The tests now fail succesfully.

jteijema commented 1 year ago
ERROR: [Errno 2] No such file or directory: '/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/asreviewcontrib/makita/templates/script_test.template'
Error: Process completed with exit code 1.

Failed

Success

The actions now succesfully capture failure. Note however that ShellCheck does not find broken comments (see #29). Any ideas @J535D165

jteijema commented 1 year ago

See https://github.com/asreview/asreview-makita/actions/runs/5179385864/jobs/9332191777 for example, where a missing shebang is not excepted from ShellCheck.

./tmp/multiple_models/jobs.sh:1:1: error: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. [SC2148]
./tmp/basic/jobs.sh:1:1: error: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. [SC2148]
./tmp/arfi/jobs.sh:1:1: error: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. [SC2148]

All generated templates are checked for everything in https://github.com/koalaman/shellcheck/blob/master/README.md#user-content-gallery-of-bad-code

jteijema commented 1 year ago

https://raw.githubusercontent.com/jteijema/asreview-makita/workflow-testing/.github/workflows/test_data/labels.csv Needs to be adjusted to the proper URL

jteijema commented 1 year ago

I've updated the linter to include template files.

jteijema commented 1 year ago


Run for file in asreviewcontrib/makita/templates/*.template; do 
Modified file: asreviewcontrib/makita/templates/doc_README.md
Modified file: asreviewcontrib/makita/templates/script_get_plot.py
Modified file: asreviewcontrib/makita/templates/script_get_settings_from_state.py
Modified file: asreviewcontrib/makita/templates/script_merge_descriptives.py
Modified file: asreviewcontrib/makita/templates/script_merge_metrics.py
Modified file: asreviewcontrib/makita/templates/script_merge_tds.py
Modified file: asreviewcontrib/makita/templates/script_split_data_with_multiple_labels.py
Modified file: asreviewcontrib/makita/templates/template_arfi.txt
Modified file: asreviewcontrib/makita/templates/template_basic.txt
Modified file: asreviewcontrib/makita/templates/template_multiple_models.txt
J535D165 commented 1 year ago

Very nice @jteijema ! Improvements are possible, so Im encouraging everyone to extend and improve this test suite.