-
-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy pathruntests.py
More file actions
executable file
·35 lines (29 loc) · 972 Bytes
/
runtests.py
File metadata and controls
executable file
·35 lines (29 loc) · 972 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, "tests")
os.environ["GITHUB_TOKEN"] = ""
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "openwisp2.settings")
if __name__ == "__main__":
from django.core.management import execute_from_command_line
args = sys.argv
args.insert(1, "test")
args.insert(2, "test_project")
args.insert(3, "openwisp_utils.metric_collection")
execute_from_command_line(args)
# Check if selenium_tests tag is requested - skip pytest in that case
skip_pytest = "--tag=selenium_tests" in args
if skip_pytest:
sys.exit(0)
# Run pytest if not skipped
import pytest
pytest_exit_code = pytest.main(
[
"openwisp_utils/releaser/tests",
".github/actions/bot-ci-failure",
".github/actions/bot-changelog-generator",
".github/actions/bot-autoassign/tests",
]
)
sys.exit(pytest_exit_code)