Skip to content

Commit

Permalink
#368: Regroup acceptance tests with unit tests (#402)
Browse files Browse the repository at this point in the history
* #368: move stepper tests and acceptance tests to the unittest tests to include in tox

* #368: update gitignore

* #368: update CI workflow

* #368: update CI workflow

* #368: update gitignore

* #368: rename acceptance to synthetic-acceptance

* #386: refactor

* #368: rename workflow

* #368: fix call error

* #368: fix bug in a test

* #368: fix bad config path for a test

* #368: rename workflow

* #368: upgrade tox and colorama dependency versions

* #368: create a single requirements.txt file

* #368: upgrade colorama version also for lbaf package setup

* #368: refactor and simlify tox.ini

* #368: rename workflow

* #368: remove method duplicate

* #368: pylint fixes

* #368: pylint fixes

* #368: disable some unexpected pylint warnings

* #368: remove unnecessary line

* #368: tentative to display unit tests results better

* #368: keep only one requirements file and try fix Test report action

* #368: try another Test report plugin

* #368: fix issue with test output

* #368: rename tests report

* #368: try again another plugin

* #368: upgrade version of test report plugin

* #368: setoption to report output on CI

* #368: fix remaining quotes and warnings

* #368: fix pylint notice messages
  • Loading branch information
tlamonthezie authored Jun 12, 2023
1 parent 7bee174 commit 1c8844a
Show file tree
Hide file tree
Showing 172 changed files with 284 additions and 369 deletions.
106 changes: 0 additions & 106 deletions .github/workflows/acceptance-tests.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/build-and-publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
print_hash: true
print-hash: true
15 changes: 12 additions & 3 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Code Quality (Unit tests, Coverage, PyLint)
name: Code Quality (Tests, Linting, Coverage)
on: push
concurrency:
group: CI-${{ github.head_ref }}
Expand Down Expand Up @@ -33,14 +33,14 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-${{ matrix.python-version }}.txt
pip install -r requirements.txt
pip install tox-gh-actions
- name: Register Github Actions Problem matchers (pylint)
run: |
echo "::add-matcher::.github/workflows/matchers/pylint.json"
- name: Running Unit-tests, Coverage, Pylint using TOX
- name: Running Tests, Pylint and Coverage using TOX
id: run_tox
run: |
tox
Expand All @@ -49,6 +49,15 @@ jobs:
if [ -e "./artifacts/coverage.txt" ]; then COVERAGE_REPORT_EXISTS="true"; else COVERAGE_REPORT_EXISTS="false"; fi
echo "coverage_report_exists=$COVERAGE_REPORT_EXISTS" >> $GITHUB_OUTPUT
- name: Report Test results
uses: phoenix-actions/test-reporting@v12
if: success() || failure()
with:
name: Tests report (${{ matrix.os }}, ${{ matrix.python-version }})
path: artifacts/unittest/reports/TEST-*.xml
reporter: java-junit
output-to: step-summary

- name: Upload pylint artifact
if: |
steps.run_tox.outputs.pylint_report_exists == 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-${{ env.python-version }}.txt
pip install -r requirements.txt
pip3 install docutils jinja2 pygments
- name: Clone documentation generator
working-directory: ${{ env.project-directory }}
Expand Down
17 changes: 8 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
__pycache__
*.egg-info
*.pyc
.coverage
.env
.pytest_cache
.tox
/.idea
/artifacts
/build
/dist
/docs/output
/m.css
/output
/tests/.pytest_cache
/tests/output
/venv
/venv39
src/Applications/Include
src/Applications/Lib
src/Applications/Scripts
src/Applications/tcl
src/lbaf/imported
output
/src/Applications/Include
/src/Applications/Lib
/src/Applications/Scripts
/src/Applications/tcl
/src/lbaf/imported
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[![Unit Tests](https://github.com/DARMA-tasking/LB-analysis-framework/actions/workflows/code-quality.yml/badge.svg)](https://github.com/DARMA-tasking/LB-analysis-framework/actions/workflows/code-quality.yml)
[![Acceptance Tests](https://github.com/DARMA-tasking/LB-analysis-framework/actions/workflows/acceptance-tests.yml/badge.svg)](https://github.com/DARMA-tasking/LB-analysis-framework/actions/workflows/acceptance-tests.yml)
[![Pylint](https://raw.githubusercontent.com/DARMA-tasking/LB-analysis-framework/deploy-badges/pylint.svg)](https://raw.githubusercontent.com/DARMA-tasking/LB-analysis-framework/deploy-badges/pylint.svg)
[![Coverage](https://raw.githubusercontent.com/DARMA-tasking/LB-analysis-framework/deploy-badges/coverage.svg)](https://raw.githubusercontent.com/DARMA-tasking/LB-analysis-framework/deploy-badges/coverage.svg)

Expand All @@ -8,6 +7,7 @@
* `src`: Load-Balancing Simulator code
* `doc`: research and papers and related documents
* `data`: various data inputs or outputs
* `tests`: unit tests and acceptance tests

### Please check Wiki for more details:
[Load Balancing Analysis Framework Wikipedia](https://github.com/DARMA-tasking/LB-analysis-framework/wiki)
Expand All @@ -22,7 +22,7 @@ Please mind your platform as well as proper 32 or 64 bit version.

Make sure you have all required Python packages installed with:
```shell
pip install -r requirements-3.8.txt
pip install -r requirements.txt
```

Requirements are divided into `LBAF dependencies` and `LBAF testing`.
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/before_starting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Make sure you have all required Pyhon packages installed with:
.. code-block:: bash
# Make sure you are in project directory
pip install -r requirements-3.8.txt
pip install -r requirements.txt
Requirements are divided into `LBAF dependencies`, `LBAF testing` and `LBAF building package`:

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Requirements for testing

A file which contains all required packages for testing purposes can be found under:

* `<project-path>/requirements-3.<x>.txt`, where `<x>` stands for python version.
* `<project-path>/requirements.txt`, where `<x>` stands for python version.

Unit testing
------------
Expand Down
18 changes: 0 additions & 18 deletions requirements-3.9.txt

This file was deleted.

10 changes: 6 additions & 4 deletions requirements-3.8.txt → requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# LBAF dependencies
vtk==9.0.1
vtk==9.0.1;python_version == '3.8'
vtk==9.1.0;python_version == '3.9'
numpy==1.22.3
PyYAML==6.0
Brotli==1.0.9
schema==0.7.5
scikit-learn==1.0.2
colorama==0.4.4
matplotlib==3.5.3
colorama==0.4.6
matplotlib==3.5.3;python_version == '3.8'
matplotlib==3.6.2;python_version == '3.9'

# LBAF testing
tox==3.24.5
tox==4.6.0
coverage==6.3.2
pylint==2.12.2
pytest==7.1.1
Expand Down
2 changes: 1 addition & 1 deletion scripts/multi_reg.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def save_data(in_files: list, y_read: dict, y_predict: dict, ranks: dict):
out_file = os.path.join(dir_path, file_name)
with open(out_file, "wt", encoding="utf-8") as o_file:
for bool_type, values in y_read.items():
for num, _val in enumerate(values):
for num, _value in enumerate(values):
o_file.write(
f"{ranks[bool_type][num]} {y_read[bool_type][num]} {y_predict[bool_type][num]}\n")

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ install_requires =
Brotli == 1.0.9
schema == 0.7.5
scikit-learn == 1.0.2
colorama == 0.4.4
colorama == 0.4.6
matplotlib==3.5.3;python_version=='3.8'
matplotlib==3.6.2;python_version=='3.9'

Expand Down
Loading

0 comments on commit 1c8844a

Please sign in to comment.