weko auto unit test tool
This script is unofficial tool for running the unit tests of the Weko3 modules.
$ cd weko
$ git clone https://github.com/ivis-kuroda/weko-autox.git auto
$ ln -s auto/autox.sh autox
$ ./autox -v
autox.sh - ver.1.2.0
autox.sh [-n] [-r] [-p module] [-o output] [-k] [-v] [-h] [all|weko|invenio] [target1 target2 ...]
all
: Run tests for all modules.invenio
: Run tests for all invenio modules.weko
: Run tests for all weko modules.
target1 target2 ...
: Specify the module names to run tox optionally.
-n
specify the module names to do not run tox by arguments.-r
Remove the egg-info and .tox directories. When permission problems occur, use this option.-p
Run tox partially by argument. Need to specify the module names and target function to run tox.-o
Specify the output directory for the log files by argument.-k
Stop the tox process.-v
Show the version.-h
Show the help message.
- run all modules.
autox.sh all
- run weko modules without weko-admin.
autox.sh weko -n weko-admin
- Specify directory to export log.
✔️ Test logs are output to log/ by default. Optionally, output can be specified to any directory under log/.
autox.sh -o example all
- run tox partially.
✔️ Immediately following the -p option is treated as an optional argument, and everything after that is treated as a script argument.
autox.sh -p weko-admin test_api.py::test_is_restricted_user test_tasks.py::test_send_all_reports
The log files are stored in the log directory.
Important
The following conditions must be satisfied in order for the progress o be displayed correctly
-
The display must fit on a single line.
-
docker does not issue a warning. Create a file in the project root as shown below.
# .env ELASTICSEARCH_S3_ACCESS_KEY= ELASTICSEARCH_S3_SECRET_KEY= ELASTICSEARCH_S3_ENDPOINT= ELASTICSEARCH_S3_BUCKET=
add options: -p
; 👏 Tests can now be run on a per-function basis.
Coverage reports are now output after tests.
delete options: -i
and -w
.
add options: -o
; specify the output directory for the log files. -v
; show the version.
add commands: all, invenio, weko.
the first script.