CWL Conformance Test について
tl;dr
- cwltool に対する pull request を作成したい
- その前に conformance test を行わなければならない
- 基本的には下記のページを参照する
- メモ書きとして、手順を自分でも残しておく
環境準備
- cwltool は fork してから、それを clone する
- 後から pull request を書くため
- conformance test を実行するためのスクリプトは GitHub - common-workflow-language/common-workflow-language に含まれている
- conformance test を実行する環境のために
pip install cwltest
を行う
環境は下記の通り
$ cat /etc/os-release NAME="Ubuntu" VERSION="16.04.6 LTS (Xenial Xerus)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 16.04.6 LTS" VERSION_ID="16.04" HOME_URL="http://www.ubuntu.com/" SUPPORT_URL="http://help.ubuntu.com/" BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/" VERSION_CODENAME=xenial UBUNTU_CODENAME=xenial $ python -V Python 3.7.2 $ pip -V pip 19.0.3 from /opt/pyenv/versions/3.7.2/lib/python3.7/site-packages/pip (python 3.7) $ pip3 list Package Version ----------------- ------------------ certifi 2019.3.9 pip 19.0.3 pipenv 2018.11.26 setuptools 41.0.0 virtualenv 16.4.3 virtualenv-clone 0.5.3 wheel 0.33.1
諸々を clone, install する
$ git clone https://github.com/suecharo/cwltool.git $ cd .. $ git clone https://github.com/common-workflow-language/common-workflow-language.git $ pip3 install cwltest $ pip3 list Package Version ----------------- ------------------ CacheControl 0.12.5 certifi 2019.3.9 chardet 3.0.4 cwltest 1.0.20190228134645 idna 2.8 isodate 0.6.0 junit-xml 1.8 lockfile 0.12.2 mistune 0.8.4 msgpack 0.6.1 pip 19.0.3 pipenv 2018.11.26 pyparsing 2.4.0 rdflib 4.2.2 rdflib-jsonld 0.4.0 requests 2.21.0 ruamel.yaml 0.15.91 schema-salad 4.1.20190305210046 setuptools 41.0.0 six 1.12.0 typing-extensions 3.7.2 urllib3 1.24.1 virtualenv 16.4.3 virtualenv-clone 0.5.3 wheel 0.33.1
cwltool を install する際、git clone
した dir 上の file をそのまま使いたいため setuptools の開発者モードを使う
$ cd cwltool $ python3 setup.py develop $ pip3 list | grep cwltool cwltool 1.0.20190402060741 /home/suecharo/GitHub/cwltool $ cwltool --version /opt/pyenv/versions/3.7.2/bin/cwltool 1.0.20190402060741
ファイルの書き換えと Conformance Test の実行
- 注意点として、
./run_test.sh
を実行したらrunner 'cwl-runner' not found
って言われるcwl-runner
の alias が設定されていないためRUNNER=cwltool
とかで実行する
- 実行にかなり時間がかかる
-j
option を使う
- ファイルを書き換える前に一度 Conformance Test を実行しておく
- そもそも Test が落ちている場合がある
$ cd common-workflow-language $ ./run_test.sh --help run_test.sh: Run common workflow tool description language conformance tests. Syntax: run_test.sh [RUNNER=/path/to/cwl-runner] [DRAFT=cwl-draft-version] [EXTRA=--optional-arguments-to-cwl-runner] Options: -nT Run a specific test. -l List tests -jJ Specifies the number of tests to run simultaneously (defaults to one). --only-tools Only test CommandLineTools --junit-xml=FILENAME Store results in JUnit XML format using the given FILENAME --classname=CLASSNAME In the JUnit XML, tag the results with the given CLASSNAME --timeout=TIMEOUT cwltest timeout in seconds. --verbose Print the cwltest invocation and pass --verbose to cwltest --self Test CWL and test .cwl files themselves. If this flag is given, any other flags will be ignored. --badgedir=DIRNAME Specifies the directory to store JSON files for badges. --tags TAGS Tags to be tested Note: EXTRA is useful for passing --enable-dev to the CWL reference runner: Example: RUNNER=cwltool EXTRA=--enable-dev
$ ./run_test.sh RUNNER=cwltool -j=32 ... All tests passed All tool tests succeeded
- ここから、
cwltool/cwltool
内を書き換えていく - 修正後、再度 Confirmance Test を実行して、test が通るようにする
- git push して、pull request を作成する