Skip to content

Commit

Permalink
Merge pull request #4816 from kobotoolbox/mark-perf-test-orgs
Browse files Browse the repository at this point in the history
Mark org speed test as 'performance', exclude performance tests from running without flag
  • Loading branch information
jnm authored Jan 24, 2024
2 parents 8b69a49 + 6e4dd77 commit 5847ee9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion kobo/apps/stripe/tests/test_organization_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def test_doesnt_include_org_users_with_invalid_plan(self):
self.expected_file_size() * self.expected_submissions_single
)

@pytest.mark.xfail
@pytest.mark.performance
def test_endpoint_speed(self):
# get the average request time for 10 hits to the endpoint
single_user_time = timeit.timeit(lambda: self.client.get(self.detail_url), number=10)
Expand Down
18 changes: 17 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,30 @@ extend-select = ["I"]
[tool.ruff.lint.isort]
known-first-party = ["kobo"]

[tool.pytest.ini_options]
testpaths = [
'kobo',
'kpi',
'hub',
]
env = [
'DJANGO_SETTINGS_MODULE=kobo.settings.testing',
]
addopts = [
'-m not performance',
]
markers = [
"performance: marks test for performance that may unexpectedly fail on slower platforms (not executed by default - select with '-m \"performance\"')",
]

# Types are not enforced but are a good practice
[tool.mypy]
# Exclude virtual environment projects that cause mypy to error
exclude = [
"src/django-digest",
"src/formpack",
"src/kobo-service-account",
"src/python-digest"
"src/python-digest",
]
[tool.django-stubs]
django_settings_module = "kobo.settings"
4 changes: 0 additions & 4 deletions pytest.ini

This file was deleted.

0 comments on commit 5847ee9

Please sign in to comment.