diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 000000000..5a7d6bd79 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,5 @@ +[run] +branch = True + +[report] +show_missing = True diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b14776d24..59d801107 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,9 +37,10 @@ jobs: - name: Install dependencies run: | sudo apt-get install -y libtidy5deb1 libzmq3-dev - pip3 install nose==1.3.7 selenium==3.141.0 coverage pyvirtualdisplay pytest - pip3 install coverage==7.6.9 pytest==8.0.0 virtualenv==20.25.0 setuptools==69.1.0\ - setuptools-scm==8.0.4 + pip install setuptools==69.1.0 setuptools-scm==8.0.4 + # pip3 install nose==1.3.7 selenium==3.141.0 coverage pyvirtualdisplay pytest + # pip3 install coverage==7.6.9 pytest==8.0.0 virtualenv==20.25.0 setuptools==69.1.0\ + # setuptools-scm==8.0.4 - name: Start services run: | @@ -49,12 +50,14 @@ jobs: - name: Install INGInious run: | pip3 install . + pip3 install .[test] - name: Launch nose tests - run: nosetests -v --with-coverage --cover-package=inginious --cover-branches --cover-html -I "^test_" + run: nose2 - name: Launch pytest tests - run: coverage run --branch -m pytest -v + if: always() + run: coverage run -a --branch -m pytest -v - name: Generate coverage report # Launch even if one of the two test jobs fails diff --git a/nose2.cfg b/nose2.cfg new file mode 100644 index 000000000..3a63f576f --- /dev/null +++ b/nose2.cfg @@ -0,0 +1,7 @@ +[unittest] +test-file-pattern=Test*.py + +[coverage] +always-on = True +coverage-combine= True +coverage-report = term-missing xml diff --git a/setup.py b/setup.py index 437321ec2..d58122e89 100644 --- a/setup.py +++ b/setup.py @@ -37,8 +37,10 @@ test_requires = [ "selenium == 3.141.0", - "nose", - "pyvirtualdisplay" + "nose2[coverage_plugin]==0.15.1", + "pytest == 8.3.4", + "pyvirtualdisplay", + "coverage == 7.6.9" ] doc_requires = [