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

Mark org speed test as 'performance', exclude performance tests from running without flag #4816

Merged
merged 2 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that the test is excluded by default, would it be worth cranking up the number of model instances to a number that you would want to use when you run performance tests? (Or, if not, adding a comment describing how someone might use the test to test performance meaningfully?)

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.

Loading