|
1 | 1 | import os
|
2 | 2 | import sys
|
3 | 3 |
|
4 |
| - |
5 | 4 | REPO_ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")
|
6 | 5 | sys.path.append(REPO_ROOT)
|
7 | 6 |
|
8 | 7 |
|
9 | 8 | def test_workflow_archiver():
|
10 | 9 | os.chdir("workflow-archiver")
|
11 | 10 |
|
12 |
| - # Lint test |
13 |
| - print("## Started model archiver linting") |
14 |
| - workflow_archiver_dir = os.path.join("workflow_archiver", ".") |
15 |
| - rc_file_path = os.path.join(".", "workflow_archiver", "tests", "pylintrc") |
16 |
| - py_lint_cmd = f"pylint -rn --rcfile={rc_file_path} {workflow_archiver_dir}" |
17 |
| - print(f"## In directory: {os.getcwd()} | Executing command: {py_lint_cmd}") |
18 |
| - py_lint_exit_code = os.system(py_lint_cmd) |
19 |
| - |
20 | 11 | # Execute python unit tests
|
21 | 12 | print("## Started workflow archiver pytests - unit tests")
|
22 | 13 | ut_dir = os.path.join("workflow_archiver", "tests", "unit_tests")
|
23 | 14 | coverage_dir = os.path.join(".")
|
24 |
| - results_dir_name = "result_units" |
25 |
| - py_units_cmd = f"python -m pytest --cov-report html:{results_dir_name} --cov={coverage_dir} {ut_dir}" |
| 15 | + report_output_dir = os.path.join(ut_dir, "coverage.xml") |
| 16 | + py_units_cmd = f"python -m pytest --cov-report xml:{report_output_dir} --cov={coverage_dir} {ut_dir}" |
26 | 17 | print(f"## In directory: {os.getcwd()} | Executing command: {py_units_cmd}")
|
27 | 18 | py_units_exit_code = os.system(py_units_cmd)
|
28 | 19 |
|
29 | 20 | # Execute integration tests
|
30 | 21 | print("## Started workflow archiver pytests - integration tests")
|
31 | 22 | it_dir = os.path.join("workflow_archiver", "tests", "integ_tests")
|
32 |
| - py_integ_cmd = f"python -m pytest {it_dir}" # ToDo - Report for Integration tests ? |
| 23 | + report_output_dir = os.path.join(it_dir, "coverage.xml") |
| 24 | + py_integ_cmd = f"python -m pytest --cov-report xml:{report_output_dir} --cov={coverage_dir} {it_dir}" |
33 | 25 | print(f"## In directory: {os.getcwd()} | Executing command: {py_integ_cmd}")
|
34 | 26 | py_integ_exit_code = os.system(py_integ_cmd)
|
35 | 27 |
|
36 |
| - if py_lint_exit_code != 0: |
37 |
| - print("## Workflow archiver Linting Failed !") |
38 | 28 | if py_units_exit_code != 0:
|
39 | 29 | sys.exit("## Workflow archiver Unit Pytests Failed !")
|
40 | 30 | if py_integ_exit_code != 0:
|
|
0 commit comments