Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] Speed up repository builds in the test suite #1202

Merged
merged 4 commits into from
Dec 3, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,16 @@ jobs:
- name: Run main tests
if: matrix.test == 'main'
# running the "main" tests means "all tests that aren't auth"
run: pytest -m "not auth" -vx --cov binderhub
run: pytest -m "not auth" -vx --cov binderhub --durations=0
betatim marked this conversation as resolved.
Show resolved Hide resolved
betatim marked this conversation as resolved.
Show resolved Hide resolved
- name: Run auth tests
if: matrix.test == 'auth'
# running the "auth" tests means "all tests that are marked as auth"
run: pytest -m "auth" -vx --cov binderhub
run: pytest -m "auth" -vx --cov binderhub --durations=0
betatim marked this conversation as resolved.
Show resolved Hide resolved
- name: Run helm tests
if: matrix.test == 'helm'
run: |
export BINDER_URL=http://localhost:30901
pytest -m "remote" -vx --cov binderhub
pytest -m "remote" -vx --cov binderhub --durations=0
betatim marked this conversation as resolved.
Show resolved Hide resolved
- name: Kubernetes namespace report
if: ${{ failure() }}
run: |
Expand Down
22 changes: 16 additions & 6 deletions binderhub/tests/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,29 @@
from .utils import async_requests


# We have optimized this slow test, for more information, see the README of
# https://github.com/binderhub-ci-repos/minimal-dockerfile.
@pytest.mark.asyncio(timeout=900)
@pytest.mark.parametrize("slug", [
"gh/binderhub-ci-repos/requirements/d687a7f9e6946ab01ef2baa7bd6d5b73c6e904fd",
"git/{}/d687a7f9e6946ab01ef2baa7bd6d5b73c6e904fd".format(
quote("https://github.com/binderhub-ci-repos/requirements", safe='')
# git/ Git repo provider
"git/{}/HEAD".format(
quote("https://github.com/consideratio/cached-minimal-dockerfile", safe='')
),
"git/{}/master".format(
quote("https://github.com/binderhub-ci-repos/requirements", safe='')
"git/{}/596b52f10efb0c9befc0c4ae850cc5175297d71c".format(
quote("https://github.com/consideratio/cached-minimal-dockerfile", safe='')
betatim marked this conversation as resolved.
Show resolved Hide resolved
),
"gl/minrk%2Fbinderhub-ci/0d4a217d40660efaa58761d8c6084e7cf5453cca",
betatim marked this conversation as resolved.
Show resolved Hide resolved
# gh/ GitHub repo provider
"gh/consideratio/cached-minimal-dockerfile/HEAD",
"gh/consideratio/cached-minimal-dockerfile/596b52f10efb0c9befc0c4ae850cc5175297d71c",
betatim marked this conversation as resolved.
Show resolved Hide resolved
# gl/ GitLab repo provider
"gl/binderhub-ci-repos%2Fcached-minimal-dockerfile/HEAD",
"gl/binderhub-ci-repos%2Fcached-minimal-dockerfile/596b52f10efb0c9befc0c4ae850cc5175297d71c",
])
@pytest.mark.remote
async def test_build(app, needs_build, needs_launch, always_build, slug, pytestconfig):
"""
Test build a repo that is very quick and easy to build.
"""
# can't use mark.github_api since only some tests here use GitHub
if slug.startswith('gh/') and "not github_api" in pytestconfig.getoption('markexpr'):
pytest.skip("Skipping GitHub API test")
Expand Down