]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Speed up test suite via distributed testing (#2196)
authorRichard Si <63936253+ichard26@users.noreply.github.com>
Fri, 7 May 2021 14:41:55 +0000 (10:41 -0400)
committerGitHub <noreply@github.com>
Fri, 7 May 2021 14:41:55 +0000 (16:41 +0200)
* Speed up test suite via distributed testing

Since we now run the test suite twice, one with Python 2 and another
without, full test runs are getting pretty slow. Let's try to
fix that with parallization.

Also use verbose mode on CI since more logs is usually better since
getting more is quite literally impossible.

The main issue we'll face with this is we'll hit
https://github.com/pytest-dev/pytest-xdist/issues/620 sometimes
(although pretty rarely). I suppose we can test this and see if how bad
this bug is for us, and revert if necessary down the line.

Also let's have some colours :tada:

.coveragerc
.github/workflows/test.yml
test_requirements.txt
tox.ini

index f05041ca1dcd199ba5aa2762d3179ae3c1a45712..5577e496a57db2b25e93983c119d4013cfaa8992 100644 (file)
@@ -3,6 +3,7 @@ omit =
   src/blib2to3/*
   tests/data/*
   */site-packages/*
+  .tox/*
 
 [run]
 relative_files = True
index 03adc7f0beac92f4d73840ccfcea2ac26cd3745d..2cfbab67ce1c124c7976751226c6a5c77096bc45 100644 (file)
@@ -33,7 +33,7 @@ jobs:
 
       - name: Unit tests
         run: |
-          tox -e py
+          tox -e py -- -v --color=yes
 
       - name: Publish coverage to Coveralls
         # If pushed / is a pull request against main repo AND
index a1464e90686ce7a98ad1904b8eacc965d6783efa..31ab2d05feac5e3b3335d4745d18cfe991dc154a 100644 (file)
@@ -3,5 +3,7 @@ pre-commit
 pytest >= 6.1.1
 pytest-mock >= 3.3.1
 pytest-cases >= 2.3.0
+pytest-xdist >= 2.2.1
+pytest-cov >= 2.11.1
 parameterized >= 0.7.4
 tox
diff --git a/tox.ini b/tox.ini
index 317bf4853758dc145570bb709924f733d624a874..2379500f55a97ea8acabfef6409d2bb8e5504d23 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -9,9 +9,9 @@ deps =
 commands =
     pip install -e .[d]
     coverage erase
-    coverage run -m pytest tests --run-optional=no_python2 {posargs}
+    pytest tests --run-optional no_python2 --numprocesses auto --cov {posargs}
     pip install -e .[d,python2]
-    coverage run -m pytest tests --run-optional=python2 {posargs}
+    pytest tests --run-optional python2 --numprocesses auto --cov --cov-append {posargs}
     coverage report
 
 [testenv:fuzz]