Skip to content

Commit

Permalink
Bug 1573987 - allow tests to run without TASKCLUSTER_ROOT_URL; r=Callek
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed Sep 22, 2019
1 parent 391dd8a commit 5a79020
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions taskcluster/ci/tests/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ jobs:
description: "Run `unit tests` to validate the latest changes"
treeherder:
symbol: unit
worker:
env:
# fail instead of skipping tests due to missing information
NO_TEST_SKIP: 1
run:
command: [python, setup.py, test]
flake8:
Expand Down
9 changes: 9 additions & 0 deletions tcadmin/tests/test_util_scopes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import pytest
import taskcluster
import os

from tcadmin.util.scopes import Resolver, satisfies
from tcadmin.resources import Role, Resources
Expand Down Expand Up @@ -225,6 +226,14 @@ def test_normalizeScopes_with_stars():

@pytest.fixture(scope="module")
def auth():
# tests using this fixture need *some* auth service, but it actually
# doesn't matter which one
if "TASKCLUSTER_ROOT_URL" not in os.environ:
msg = "TASKCLUSTER_ROOT_URL not set"
if "NO_TEST_SKIP" in os.environ:
pytest.fail(msg)
else:
pytest.skip(msg)
return taskcluster.Auth(taskcluster.optionsFromEnvironment())


Expand Down

0 comments on commit 5a79020

Please sign in to comment.