diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 0effcb038..ba737fee3 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -24,14 +24,16 @@ jobs: python-version: '3.11' - name: Update package index run: sudo apt-get update - - name: Install mpi libs - run: sudo apt-get -y install libopenmpi-dev - - name: Install Tox and any other packages - run: pip install tox - - name: Run Coverage Part 1 - run: tox -e cov1 - - name: Run Coverage Part 2 - run: tox -e cov2 || true + - name: Install ARMI and MPI + run: | + sudo apt-get -y install libopenmpi-dev + pip install -e .[memprof,mpi,test] + - name: Run Coverage + run: | + coverage run --rcfile=.coveragerc -m pytest -n 4 --cov=armi --cov-config=.coveragerc --cov-report=lcov --ignore=venv armi + mpiexec -n 2 --use-hwthread-cpus coverage run --rcfile=.coveragerc -m pytest --cov=armi --cov-config=.coveragerc --cov-report=lcov --cov-append --ignore=venv armi/tests/test_mpiFeatures.py || true + mpiexec -n 2 --use-hwthread-cpus coverage run --rcfile=.coveragerc -m pytest --cov=armi --cov-config=.coveragerc --cov-report=lcov --cov-append --ignore=venv armi/tests/test_mpiParameters.py || true + coverage combine --rcfile=.coveragerc --keep -a - name: Publish to coveralls.io uses: coverallsapp/github-action@v1.1.2 with: diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index a73ac49a3..4e928c4f7 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -22,12 +22,15 @@ jobs: run: sudo apt-get -y install libopenmpi-dev - name: Install Pandoc run: sudo apt-get -y install pandoc - - name: Install Tox and any other packages - run: pip install tox - name: Setup Graphviz uses: ts-graphviz/setup-graphviz@v1 - name: Make HTML Docs - run: tox -e doc + run: | + pip install -e .[memprof,mpi,test,docs] + cd doc + git submodule init + git submodule update + make html - name: deploy uses: JamesIves/github-pages-deploy-action@4.1.5 with: diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index af340c393..c9cba039e 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -15,7 +15,7 @@ jobs: python-version: '3.9' - name: Update package index run: sudo apt-get update - - name: Install Tox and any other packages - run: pip install tox - name: Run Linter - run: tox -e lint + run: | + pip install -e .[test] + ruff . diff --git a/.github/workflows/unittests.yaml b/.github/workflows/unittests.yaml index 6e1d950c3..8679712c6 100644 --- a/.github/workflows/unittests.yaml +++ b/.github/workflows/unittests.yaml @@ -26,7 +26,10 @@ jobs: run: sudo apt-get update - name: Install mpi libs run: sudo apt-get -y install libopenmpi-dev - - name: Install Tox and any other packages - run: pip install tox - - name: Run Tox - run: tox -e test,mpitest + - name: Run Tests and Coverage + run: | + pip install -e .[memprof,mpi,test] + pytest -n 4 armi + mpiexec -n 2 --use-hwthread-cpus coverage run --rcfile=.coveragerc -m pytest --cov=armi --cov-config=.coveragerc --cov-report=lcov --cov-append --ignore=venv armi/tests/test_mpiFeatures.py || true + mpiexec -n 2 --use-hwthread-cpus coverage run --rcfile=.coveragerc -m pytest --cov=armi --cov-config=.coveragerc --cov-report=lcov --cov-append --ignore=venv armi/tests/test_mpiParameters.py || true + coverage combine --rcfile=.coveragerc --keep -a diff --git a/.github/workflows/validatemanifest.yaml b/.github/workflows/validatemanifest.yaml index c9e86c371..90b53f0be 100644 --- a/.github/workflows/validatemanifest.yaml +++ b/.github/workflows/validatemanifest.yaml @@ -13,7 +13,7 @@ jobs: uses: actions/setup-python@v2 with: python-version: '3.11' - - name: Install Tox and any other packages - run: pip install tox - - name: Run Tox - run: tox -e manifest + - name: Validate Manifest + run: | + pip install toml + python .github/workflows/validatemanifest.py diff --git a/.github/workflows/wintests.yaml b/.github/workflows/wintests.yaml index 9faf86900..1ad83cf67 100644 --- a/.github/workflows/wintests.yaml +++ b/.github/workflows/wintests.yaml @@ -21,9 +21,9 @@ jobs: python-version: '3.11' - name: Upgrade PIP run: python -m pip install --upgrade pip - - name: Install deps - run: python -m pip install tox tox-gh-actions - - name: Run Tox - run: tox -e test + - name: Run Unit Tests on Windows + run: | + pip install -e .[memprof,mpi,test] + pytest -n 4 armi - name: Find Test Crumbs run: python .github/workflows/find_test_crumbs.py diff --git a/README.rst b/README.rst index 37e7d2e12..8f6bb1fd4 100644 --- a/README.rst +++ b/README.rst @@ -79,16 +79,8 @@ Now clone and install ARMI:: $ pip install -e . $ armi --help -The easiest way to run the tests is to install `tox `_ -and then run:: - - $ pip install -e ".[test]" - $ tox -- -n 6 - -This runs the unit tests in parallel on 6 processes. Omit the ``-n 6`` argument -to run on a single process. - -The tests can also be run directly, using ``pytest``:: +The ARMI tests are meant to be run using `pytest `_ +locally :: $ pip install -e ".[test]" $ pytest -n 4 armi diff --git a/doc/developer/first_time_contributors.rst b/doc/developer/first_time_contributors.rst index e4130048b..00cd676fb 100644 --- a/doc/developer/first_time_contributors.rst +++ b/doc/developer/first_time_contributors.rst @@ -28,17 +28,10 @@ Any contribution must pass all included unit tests. You will frequently have to tests your code changes break. And you should definitely add tests to cover anything new your code does. -The standard way to run the tests is to install and use `tox `_:: +The ARMI tests are meant to be run using `pytest `_ +locally :: - $ pip install tox - $ tox -- -n 6 - -This runs the unit tests in parallel on 6 processes. Omit the ``-n 6`` argument -to run on a single process. - -Or the tests can also be run using ``pytest`` directly:: - - $ pip intall -e .[test] + $ pip install -e .[test] $ pytest -n 4 armi Submitting Changes diff --git a/tox.ini b/tox.ini deleted file mode 100644 index c7e4a6693..000000000 --- a/tox.ini +++ /dev/null @@ -1,87 +0,0 @@ -[tox] -envlist = py38,lint,cov -requires = - pip >= 20.2 - -[testenv] -basepython = {env:PYTHON3_PATH:python3} -setenv = - PYTHONPATH = {toxinidir} - USERNAME = armi - -[testenv:test] -commands = - pip install -e .[memprof,mpi,test] - pytest -n 4 armi - -[testenv:doc] -allowlist_externals = - /usr/bin/git - /usr/bin/make -changedir = doc -commands = - pip install -e ..[memprof,mpi,test,docs] - git submodule init - git submodule update - make html - -# First, run code coverage over the rest of the usual unit tests. -[testenv:cov1] -deps= - mpi4py -allowlist_externals = - /usr/bin/mpiexec -commands = - pip install -e .[memprof,mpi,test] - coverage run --rcfile=.coveragerc -m pytest -n 4 --cov=armi --cov-config=.coveragerc --cov-report=lcov --ignore=venv armi - -# Second, run code coverage over the unit tests that run MPI library code, and combine the coverage results together. -[testenv:cov2] -deps= - mpi4py -allowlist_externals = - /usr/bin/mpiexec -commands = - pip install -e .[memprof,mpi,test] - mpiexec -n 2 --use-hwthread-cpus coverage run --rcfile=.coveragerc -m pytest --cov=armi --cov-config=.coveragerc --cov-report=lcov --cov-append --ignore=venv armi/tests/test_mpiFeatures.py - mpiexec -n 2 --use-hwthread-cpus coverage run --rcfile=.coveragerc -m pytest --cov=armi --cov-config=.coveragerc --cov-report=lcov --cov-append --ignore=venv armi/tests/test_mpiParameters.py - coverage combine --rcfile=.coveragerc --keep -a - -# NOTE: This only runs the MPI unit tests. -# NOTE: This will only work in POSIX/BASH Linux. -[testenv:mpitest] -deps= - mpi4py -allowlist_externals = - /usr/bin/mpiexec -commands = - pip install -e .[memprof,mpi,test] - mpiexec -n 2 --use-hwthread-cpus pytest armi/tests/test_mpiFeatures.py - mpiexec -n 2 --use-hwthread-cpus pytest armi/tests/test_mpiParameters.py - -[testenv:lint] -deps= - ruff==0.0.272 -commands = - ruff . - -[testenv:report] -skip_install = true -deps= - mpi4py -commands = - coverage report - coverage html - -[testenv:manifest] -basepython = {env:PYTHON3_PATH:python3} -setenv = - PYTHONPATH = {toxinidir} - USERNAME = armi -commands = - python .github/workflows/validatemanifest.py - -[testenv:clean] -deps = coverage -skip_install = true -commands = coverage erase