aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/pytest.ini
diff options
context:
space:
mode:
authorGravatar jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com>2021-02-05 06:10:42 -0800
committerGravatar GitHub <noreply@github.com>2021-02-05 06:10:42 -0800
commit6e38a76220f7747eb4a1f9b13dd3caf9e84f091c (patch)
tree44478af35bb26e4366f06e289c8f7014b3dacc47 /infra/pytest.ini
parente4a2de5fab58f8fa35f8c04980b8893aecc53372 (diff)
[infra] Improve test speed (#5118)
Make unittests take 20 seconds to run instead of 35. Make integration tests take 50 seconds to run instead of 6 minutes. Make CI take 6 minutes instead of 12 minutes. 1. Allow running tests in parallel. Locally this takes the time for running all tests (including integration tests) from 6 minutes to ~50 seconds. We don't do parallel by default since it doesn't really save any time unless running integration tests on my machine (probably due to overhead of starting ~70 processes). This also speeds up CI from about 12 minutes to 6 minutes (since github actions has 2 cores per machine). 2. Fix how we run tests. I'm not exactly sure why, but the method we used for discovering tests, recursing through every directory and passing to unittest caused the build/infra tests to execute twice. Fixing this makes running unittests take ~20 seconds instead of ~35. This change also uses pytest for running tests since it's easy to use it to run tests in parallel. This change was made possible by #5113
Diffstat (limited to 'infra/pytest.ini')
-rw-r--r--infra/pytest.ini2
1 files changed, 2 insertions, 0 deletions
diff --git a/infra/pytest.ini b/infra/pytest.ini
new file mode 100644
index 00000000..d9bb3737
--- /dev/null
+++ b/infra/pytest.ini
@@ -0,0 +1,2 @@
+[pytest]
+python_files = *_test.py \ No newline at end of file