xeet 0.5.4.post2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xeet-0.5.4.post2/.gitignore +25 -0
- xeet-0.5.4.post2/LICENSE +21 -0
- xeet-0.5.4.post2/PKG-INFO +21 -0
- xeet-0.5.4.post2/README.md +0 -0
- xeet-0.5.4.post2/TODO.txt +20 -0
- xeet-0.5.4.post2/pyproject.toml +43 -0
- xeet-0.5.4.post2/requirements.dev.txt +3 -0
- xeet-0.5.4.post2/requirements.txt +5 -0
- xeet-0.5.4.post2/schemas/xeet_schema_v0.1.json +39 -0
- xeet-0.5.4.post2/scripts/update_user_xeet.sh +24 -0
- xeet-0.5.4.post2/setup.cfg +4 -0
- xeet-0.5.4.post2/src/xeet/__init__.py +12 -0
- xeet-0.5.4.post2/src/xeet/__main__.py +149 -0
- xeet-0.5.4.post2/src/xeet/_version.py +16 -0
- xeet-0.5.4.post2/src/xeet/actions.py +376 -0
- xeet-0.5.4.post2/src/xeet/common.py +159 -0
- xeet-0.5.4.post2/src/xeet/config.py +218 -0
- xeet-0.5.4.post2/src/xeet/log.py +128 -0
- xeet-0.5.4.post2/src/xeet/pr.py +43 -0
- xeet-0.5.4.post2/src/xeet/runtime.py +43 -0
- xeet-0.5.4.post2/src/xeet/schema.py +177 -0
- xeet-0.5.4.post2/src/xeet/xtest.py +502 -0
- xeet-0.5.4.post2/src/xeet.egg-info/PKG-INFO +21 -0
- xeet-0.5.4.post2/src/xeet.egg-info/SOURCES.txt +111 -0
- xeet-0.5.4.post2/src/xeet.egg-info/dependency_links.txt +1 -0
- xeet-0.5.4.post2/src/xeet.egg-info/entry_points.txt +2 -0
- xeet-0.5.4.post2/src/xeet.egg-info/requires.txt +2 -0
- xeet-0.5.4.post2/src/xeet.egg-info/top_level.txt +1 -0
- xeet-0.5.4.post2/tests/diff_test_output.sh +44 -0
- xeet-0.5.4.post2/tests/env_tests/diff_test_output.sh +44 -0
- xeet-0.5.4.post2/tests/env_tests/env_file.json +4 -0
- xeet-0.5.4.post2/tests/env_tests/runtests +56 -0
- xeet-0.5.4.post2/tests/env_tests/test_output.sh +18 -0
- xeet-0.5.4.post2/tests/env_tests/update_test_output.sh +29 -0
- xeet-0.5.4.post2/tests/env_tests/xeet.expected/001_env_simple/stderr +0 -0
- xeet-0.5.4.post2/tests/env_tests/xeet.expected/001_env_simple/stdout +2 -0
- xeet-0.5.4.post2/tests/env_tests/xeet.expected/002_with_file/stderr +0 -0
- xeet-0.5.4.post2/tests/env_tests/xeet.expected/002_with_file/stdout +2 -0
- xeet-0.5.4.post2/tests/env_tests/xeet.expected/002_with_file/verification +1 -0
- xeet-0.5.4.post2/tests/env_tests/xeet.expected/003_with_file_override_by_local/stderr +0 -0
- xeet-0.5.4.post2/tests/env_tests/xeet.expected/003_with_file_override_by_local/stdout +3 -0
- xeet-0.5.4.post2/tests/env_tests/xeet.expected/003_with_file_override_by_local/verification +1 -0
- xeet-0.5.4.post2/tests/env_tests/xeet.json +43 -0
- xeet-0.5.4.post2/tests/for_list_and_info.json +41 -0
- xeet-0.5.4.post2/tests/out_bhv/diff_test_output.sh +44 -0
- xeet-0.5.4.post2/tests/out_bhv/runtests +56 -0
- xeet-0.5.4.post2/tests/out_bhv/test_output.sh +18 -0
- xeet-0.5.4.post2/tests/out_bhv/update_test_output.sh +29 -0
- xeet-0.5.4.post2/tests/out_bhv/xeet.expected/001_out_only/stderr +0 -0
- xeet-0.5.4.post2/tests/out_bhv/xeet.expected/001_out_only/stdout +1 -0
- xeet-0.5.4.post2/tests/out_bhv/xeet.expected/002_err_only/stderr +1 -0
- xeet-0.5.4.post2/tests/out_bhv/xeet.expected/002_err_only/stdout +0 -0
- xeet-0.5.4.post2/tests/out_bhv/xeet.expected/003_out_and_err/stderr +1 -0
- xeet-0.5.4.post2/tests/out_bhv/xeet.expected/003_out_and_err/stdout +1 -0
- xeet-0.5.4.post2/tests/out_bhv/xeet.expected/004_no_output/stderr +0 -0
- xeet-0.5.4.post2/tests/out_bhv/xeet.expected/004_no_output/stdout +0 -0
- xeet-0.5.4.post2/tests/out_bhv/xeet.expected/007_unified_output/stdout +2 -0
- xeet-0.5.4.post2/tests/out_bhv/xeet.json +74 -0
- xeet-0.5.4.post2/tests/runtests +56 -0
- xeet-0.5.4.post2/tests/sanity/aux/015d_test_verification_ok.txt +1 -0
- xeet-0.5.4.post2/tests/sanity/diff_test_output.sh +44 -0
- xeet-0.5.4.post2/tests/sanity/runtests +56 -0
- xeet-0.5.4.post2/tests/sanity/test_output.sh +18 -0
- xeet-0.5.4.post2/tests/sanity/update_test_output.sh +29 -0
- xeet-0.5.4.post2/tests/sanity/xeet.expected/001_pass/stderr +0 -0
- xeet-0.5.4.post2/tests/sanity/xeet.expected/001_pass/stdout +1 -0
- xeet-0.5.4.post2/tests/sanity/xeet.expected/007 with spaces/stdout +0 -0
- xeet-0.5.4.post2/tests/sanity/xeet.expected/008b_inherits_bad_command_to_good/stdout +0 -0
- xeet-0.5.4.post2/tests/sanity/xeet.expected/009_env_pass/stderr +0 -0
- xeet-0.5.4.post2/tests/sanity/xeet.expected/009_env_pass/stdout +1 -0
- xeet-0.5.4.post2/tests/sanity/xeet.expected/013_multi_rc_passing/stdout +1 -0
- xeet-0.5.4.post2/tests/sanity/xeet.expected/014a_show_auto_vars_internal/stderr +0 -0
- xeet-0.5.4.post2/tests/sanity/xeet.expected/014a_show_auto_vars_internal/stdout +6 -0
- xeet-0.5.4.post2/tests/sanity/xeet.expected/014b_show_auto_vars_env/stderr +0 -0
- xeet-0.5.4.post2/tests/sanity/xeet.expected/014b_show_auto_vars_env/stdout +6 -0
- xeet-0.5.4.post2/tests/sanity/xeet.json +178 -0
- xeet-0.5.4.post2/tests/scripts/common.inc.sh +105 -0
- xeet-0.5.4.post2/tests/scripts/devel_common.inc.sh +44 -0
- xeet-0.5.4.post2/tests/scripts/dflt_output_compare.sh +6 -0
- xeet-0.5.4.post2/tests/scripts/diff_test_output.sh +44 -0
- xeet-0.5.4.post2/tests/scripts/runtests +56 -0
- xeet-0.5.4.post2/tests/scripts/test_output.sh +18 -0
- xeet-0.5.4.post2/tests/scripts/update_test_output.sh +29 -0
- xeet-0.5.4.post2/tests/test_output.sh +18 -0
- xeet-0.5.4.post2/tests/update_test_output.sh +29 -0
- xeet-0.5.4.post2/tests/xeet.expected/001_all/stderr +0 -0
- xeet-0.5.4.post2/tests/xeet.expected/001_all/stdout +52 -0
- xeet-0.5.4.post2/tests/xeet.expected/002_single-test-pass/stderr +0 -0
- xeet-0.5.4.post2/tests/xeet.expected/002_single-test-pass/stdout +8 -0
- xeet-0.5.4.post2/tests/xeet.expected/003_single-test-fail/stderr +0 -0
- xeet-0.5.4.post2/tests/xeet.expected/003_single-test-fail/stdout +11 -0
- xeet-0.5.4.post2/tests/xeet.expected/004_single-group-passing/stderr +0 -0
- xeet-0.5.4.post2/tests/xeet.expected/004_single-group-passing/stdout +27 -0
- xeet-0.5.4.post2/tests/xeet.expected/005_single-group-not-run/stderr +0 -0
- xeet-0.5.4.post2/tests/xeet.expected/005_single-group-not-run/stdout +18 -0
- xeet-0.5.4.post2/tests/xeet.expected/006_single-group-failing/stderr +0 -0
- xeet-0.5.4.post2/tests/xeet.expected/006_single-group-failing/stdout +16 -0
- xeet-0.5.4.post2/tests/xeet.expected/007_pass_and_skip/stderr +0 -0
- xeet-0.5.4.post2/tests/xeet.expected/007_pass_and_skip/stdout +10 -0
- xeet-0.5.4.post2/tests/xeet.expected/008_fail_and_not_run/stderr +0 -0
- xeet-0.5.4.post2/tests/xeet.expected/008_fail_and_not_run/stdout +15 -0
- xeet-0.5.4.post2/tests/xeet.expected/009_pass_and_not_run_groups/stderr +0 -0
- xeet-0.5.4.post2/tests/xeet.expected/009_pass_and_not_run_groups/stdout +38 -0
- xeet-0.5.4.post2/tests/xeet.expected/050_environment_tests/stderr +0 -0
- xeet-0.5.4.post2/tests/xeet.expected/050_environment_tests/stdout +14 -0
- xeet-0.5.4.post2/tests/xeet.expected/100_output_passing/stderr +0 -0
- xeet-0.5.4.post2/tests/xeet.expected/100_output_passing/stdout +13 -0
- xeet-0.5.4.post2/tests/xeet.expected/200_list_tests/stdout +7 -0
- xeet-0.5.4.post2/tests/xeet.expected/201_list_tests_all/stdout +8 -0
- xeet-0.5.4.post2/tests/xeet.expected/202_list_tests_group/stdout +4 -0
- xeet-0.5.4.post2/tests/xeet.expected/203_list_tests_2groups/stdout +5 -0
- xeet-0.5.4.post2/tests/xeet.json +124 -0
- xeet-0.5.4.post2/xeet +25 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
*.swp
|
|
2
|
+
pyrightconfig.json
|
|
3
|
+
.vimspector.json
|
|
4
|
+
.idea/
|
|
5
|
+
__pycache__/
|
|
6
|
+
xeet.out/
|
|
7
|
+
.tasks.json
|
|
8
|
+
xeet.log
|
|
9
|
+
.python-version
|
|
10
|
+
_version.py
|
|
11
|
+
.tasks.json
|
|
12
|
+
|
|
13
|
+
# Virtual Environments
|
|
14
|
+
.env/
|
|
15
|
+
.venv/
|
|
16
|
+
env/
|
|
17
|
+
venv/
|
|
18
|
+
ENV/
|
|
19
|
+
env.bak/
|
|
20
|
+
venv.bak/
|
|
21
|
+
|
|
22
|
+
# Packaging
|
|
23
|
+
build/
|
|
24
|
+
dist/
|
|
25
|
+
*egg-info**
|
xeet-0.5.4.post2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Omer Caspi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: xeet
|
|
3
|
+
Version: 0.5.4.post2
|
|
4
|
+
Summary: Xfstests inspired End to End Test suite
|
|
5
|
+
Author-email: Omer Caspi <omer.caspi@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/omercsp/xeet
|
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Classifier: Topic :: Utilities
|
|
10
|
+
Classifier: Programming Language :: Python
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Requires-Python: <4,>=3.7
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: argcomplete>=2.0.0
|
|
21
|
+
Requires-Dist: jsonschema>=3.2.0
|
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
- Add variable matrix support
|
|
2
|
+
- Validate multi configuration files support
|
|
3
|
+
- Add colored log support
|
|
4
|
+
- Improve logging: time stamp
|
|
5
|
+
- Add quiet mode 1 - no unrelated test output (splash and so)
|
|
6
|
+
- Add quiet mode 2 - no output at all but errors
|
|
7
|
+
- Add quiet mode 3 - no output at all
|
|
8
|
+
- Add parallel execution
|
|
9
|
+
- Add test randomization
|
|
10
|
+
- Add empty output option
|
|
11
|
+
- Add auto variables: output file(s), RC, diff file, expected output file
|
|
12
|
+
- Separate test excution and test print outs - preperation for server mode
|
|
13
|
+
- Add server mode
|
|
14
|
+
- Add time output
|
|
15
|
+
- Add save results to file option
|
|
16
|
+
-- Add compare with last run time support
|
|
17
|
+
-- Add run only last failed tests
|
|
18
|
+
- Add log retention policy option (number of runs to keep)
|
|
19
|
+
- Add test CLI editor
|
|
20
|
+
- Add test rename capability (should rename result file as well)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=60", "setuptools_scm[toml]>=8.0.1"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "xeet"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Xfstests inspired End to End Test suite"
|
|
9
|
+
authors = [
|
|
10
|
+
{name = "Omer Caspi", email = "omer.caspi@gmail.com"},
|
|
11
|
+
]
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
classifiers = [
|
|
14
|
+
"License :: OSI Approved :: MIT License",
|
|
15
|
+
"Operating System :: OS Independent",
|
|
16
|
+
"Topic :: Utilities",
|
|
17
|
+
"Programming Language :: Python",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.7",
|
|
20
|
+
"Programming Language :: Python :: 3.8",
|
|
21
|
+
"Programming Language :: Python :: 3.9",
|
|
22
|
+
"Programming Language :: Python :: 3.10",
|
|
23
|
+
"Programming Language :: Python :: 3.11"
|
|
24
|
+
]
|
|
25
|
+
dependencies = [
|
|
26
|
+
"argcomplete>=2.0.0",
|
|
27
|
+
"jsonschema>=3.2.0"
|
|
28
|
+
]
|
|
29
|
+
requires-python = ">=3.7,<4"
|
|
30
|
+
|
|
31
|
+
[project.urls]
|
|
32
|
+
"Homepage" = "https://github.com/omercsp/xeet"
|
|
33
|
+
|
|
34
|
+
[project.scripts]
|
|
35
|
+
xeet = "xeet.__main__:xrun"
|
|
36
|
+
|
|
37
|
+
[tool.setuptools]
|
|
38
|
+
packages = ["xeet"]
|
|
39
|
+
package-dir = {'' = "src"}
|
|
40
|
+
|
|
41
|
+
[tool.setuptools_scm]
|
|
42
|
+
local_scheme = "dirty-tag"
|
|
43
|
+
version_file = "src/xeet/_version.py"
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://example.com/product.schema.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"$schema": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"minLength": 1
|
|
9
|
+
},
|
|
10
|
+
"include": {
|
|
11
|
+
"type": "array",
|
|
12
|
+
"items": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"minLength": 1
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"tests": {
|
|
18
|
+
"type": "array",
|
|
19
|
+
"items": {
|
|
20
|
+
"type": "object"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"suppress": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"items": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"minLength": 1
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"variables": {
|
|
31
|
+
"type": "object"
|
|
32
|
+
},
|
|
33
|
+
"default_shell_path": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"minLength": 1
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"additionalProperties": false
|
|
39
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# get script directory
|
|
3
|
+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
4
|
+
XEET_DIR=${DIR}/..
|
|
5
|
+
|
|
6
|
+
# check if we are insisde a virtual environment and deactivate it
|
|
7
|
+
if [[ $VIRTUAL_ENV != "" ]]; then
|
|
8
|
+
echo "deactivate virtual environment"
|
|
9
|
+
deactivate
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
# check if xeet is installed by pip
|
|
13
|
+
if [[ $(pip list | grep xeet) != "" ]]; then
|
|
14
|
+
echo "xeet is installed by pip"
|
|
15
|
+
pip uninstall xeet -y
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
cd ${XEET_DIR} || exit 1
|
|
19
|
+
pip install .
|
|
20
|
+
rm -rf ${XEET_DIR}/build ${XEET_DIR}/dist ${XEET_DIR}/xeet.egg-info
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import os.path
|
|
2
|
+
import importlib.util
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
__version_path = os.path.join(os.path.dirname(__file__), "_version.py")
|
|
6
|
+
try:
|
|
7
|
+
__spec = importlib.util.spec_from_file_location("_version", __version_path)
|
|
8
|
+
__module = importlib.util.module_from_spec(__spec) # type: ignore
|
|
9
|
+
__spec.loader.exec_module(__module) # type: ignore
|
|
10
|
+
xeet_version = __module.__version__
|
|
11
|
+
except (FileNotFoundError, ModuleNotFoundError, AttributeError):
|
|
12
|
+
xeet_version = "0.0.0"
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
from xeet import xeet_version
|
|
2
|
+
from xeet.config import Config
|
|
3
|
+
from xeet.common import XeetException, XEET_NO_TOKEN, XEET_YES_TOKEN
|
|
4
|
+
from xeet.log import init_logging, log_error
|
|
5
|
+
from xeet.pr import pr_bright, set_no_color_print
|
|
6
|
+
from xeet.actions import *
|
|
7
|
+
import sys
|
|
8
|
+
import argparse
|
|
9
|
+
import argcomplete
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
RUN_CMD = "run"
|
|
13
|
+
LIST_CMD = "list"
|
|
14
|
+
GROUPS_CMD = "groups"
|
|
15
|
+
INFO_CMD = "info"
|
|
16
|
+
DUMP_XTEST_CMD = "dump"
|
|
17
|
+
DUMP_CONFIG_CMD = "dump_config"
|
|
18
|
+
DUMP_SCHEMA_CMD = "dump_schema"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def parse_arguments() -> argparse.Namespace:
|
|
22
|
+
yes_no: list[str] = [XEET_NO_TOKEN, XEET_YES_TOKEN]
|
|
23
|
+
|
|
24
|
+
parser = argparse.ArgumentParser(prog='xeet')
|
|
25
|
+
parser.add_argument('--version', action='version', version=f'v{xeet_version}')
|
|
26
|
+
parser.add_argument('--no-colors', action='store_true', default=False, help='disable colors')
|
|
27
|
+
parser.add_argument('--no-splash', action='store_true',
|
|
28
|
+
default=False, help='don\'t show splash')
|
|
29
|
+
|
|
30
|
+
common_parser = argparse.ArgumentParser(add_help=False)
|
|
31
|
+
common_parser.add_argument('-v', '--verbose', action='count',
|
|
32
|
+
help='log file verbosity', default=0)
|
|
33
|
+
common_parser.add_argument('-c', '--conf', metavar='CONF', help='configuration file to use',
|
|
34
|
+
default="xeet.json")
|
|
35
|
+
common_parser.add_argument('--log-file', metavar='FILE', help='set log file', default=None)
|
|
36
|
+
|
|
37
|
+
test_groups_parser = argparse.ArgumentParser(add_help=False)
|
|
38
|
+
test_groups_parser.add_argument('-g', '--group', metavar='GROUP', default=[], action='append',
|
|
39
|
+
help='run tests in this group')
|
|
40
|
+
test_groups_parser.add_argument('-G', '--require-group', metavar='GROUP', default=[],
|
|
41
|
+
action='append', help='require tests to be in this group')
|
|
42
|
+
test_groups_parser.add_argument('-X', '--exclude-group', metavar='GROUP', default=[],
|
|
43
|
+
action='append', help='exclude tests in this group')
|
|
44
|
+
|
|
45
|
+
subparsers = parser.add_subparsers(help='commands', dest='subparsers_name')
|
|
46
|
+
subparsers.required = True
|
|
47
|
+
|
|
48
|
+
run_parser = subparsers.add_parser(RUN_CMD, help='run a test',
|
|
49
|
+
parents=[common_parser, test_groups_parser])
|
|
50
|
+
run_parser.add_argument('-t', '--test-name', metavar='TESTS', default=[],
|
|
51
|
+
help='test names', action='append')
|
|
52
|
+
run_parser.add_argument('--debug', action='store_true', default=False,
|
|
53
|
+
help='run tests in debug mode')
|
|
54
|
+
run_parser.add_argument('-r', '--repeat', metavar='COUNT', default=1, type=int,
|
|
55
|
+
help='repeat count')
|
|
56
|
+
run_parser.add_argument('--cmd', metavar='CMD', default=None, help='set test command')
|
|
57
|
+
run_parser.add_argument('--cwd', metavar='DIR', default=None, help='set test working directory')
|
|
58
|
+
run_parser.add_argument('--shell', type=str, choices=yes_no, action='store', default=None,
|
|
59
|
+
help='set shell usage')
|
|
60
|
+
run_parser.add_argument('--shell-path', metavar='PATH', help='set shell path', default=None)
|
|
61
|
+
run_parser.add_argument('--env-file', metavar='FILE',
|
|
62
|
+
default=None, help='environment file path')
|
|
63
|
+
run_parser.add_argument('--show-summary', action='store_true', default=False,
|
|
64
|
+
help='show test summary before run')
|
|
65
|
+
run_parser.add_argument('-V', '--variable', metavar='VAR', default=[], action='append',
|
|
66
|
+
help='set a variable')
|
|
67
|
+
|
|
68
|
+
info_parser = subparsers.add_parser(INFO_CMD, help='show test info', parents=[common_parser])
|
|
69
|
+
info_parser.add_argument('-t', '--test-name', metavar='TEST', default=None,
|
|
70
|
+
help='set test name', required=True)
|
|
71
|
+
info_parser.add_argument('-x', '--expand', help='expand values', action='store_true',
|
|
72
|
+
default=False)
|
|
73
|
+
|
|
74
|
+
dump_parser = subparsers.add_parser(DUMP_XTEST_CMD, help='dump a test',
|
|
75
|
+
parents=[common_parser])
|
|
76
|
+
dump_parser.add_argument('-t', '--test-name', metavar='TEST', default=None,
|
|
77
|
+
help='set test name', required=True)
|
|
78
|
+
|
|
79
|
+
dump_parser.add_argument('-i', '--includes', help='with inclusions',
|
|
80
|
+
action='store_true', default=False)
|
|
81
|
+
|
|
82
|
+
list_parser = subparsers.add_parser(LIST_CMD, help='list tests',
|
|
83
|
+
parents=[common_parser, test_groups_parser])
|
|
84
|
+
list_parser.add_argument('-a', '--all', action='store_true', default=False,
|
|
85
|
+
help='show hidden and shadowed tests')
|
|
86
|
+
list_parser.add_argument('--names-only', action='store_true', default=False,
|
|
87
|
+
help=argparse.SUPPRESS)
|
|
88
|
+
|
|
89
|
+
subparsers.add_parser(GROUPS_CMD, help='list groups',
|
|
90
|
+
parents=[common_parser, test_groups_parser])
|
|
91
|
+
|
|
92
|
+
dump_parser = subparsers.add_parser(DUMP_SCHEMA_CMD, help='dump configuration file schema',
|
|
93
|
+
parents=[common_parser])
|
|
94
|
+
dump_schema_choices = [DUMP_UNIFIED_SCHEMA, DUMP_CONFIG_SCHEMA, DUMP_XTEST_SCHEMA]
|
|
95
|
+
dump_parser.add_argument('-s', '--schema', choices=dump_schema_choices,
|
|
96
|
+
default=DUMP_UNIFIED_SCHEMA)
|
|
97
|
+
|
|
98
|
+
subparsers.add_parser(DUMP_CONFIG_CMD, help='dump configuration')
|
|
99
|
+
|
|
100
|
+
argcomplete.autocomplete(parser, always_complete_options=False)
|
|
101
|
+
args = parser.parse_args()
|
|
102
|
+
if args.subparsers_name == RUN_CMD and \
|
|
103
|
+
args.test_name and \
|
|
104
|
+
(args.group or args.require_group or args.exclude_group):
|
|
105
|
+
parser.error("test name and groups are mutually exclusive")
|
|
106
|
+
return args
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def xrun() -> int:
|
|
110
|
+
args = parse_arguments()
|
|
111
|
+
if args.no_colors:
|
|
112
|
+
set_no_color_print()
|
|
113
|
+
|
|
114
|
+
if not args.no_splash:
|
|
115
|
+
title = f"Xeet, v{xeet_version}"
|
|
116
|
+
pr_bright(f"{title}\n{'=' * len(title)}\n")
|
|
117
|
+
|
|
118
|
+
try:
|
|
119
|
+
log_ok, err_msg = init_logging(args.log_file, args.verbose)
|
|
120
|
+
if not log_ok:
|
|
121
|
+
raise XeetException(err_msg)
|
|
122
|
+
cmd_name = args.subparsers_name
|
|
123
|
+
if cmd_name == DUMP_SCHEMA_CMD:
|
|
124
|
+
dump_schema(args.schema)
|
|
125
|
+
return 0
|
|
126
|
+
|
|
127
|
+
expand = cmd_name == RUN_CMD or (cmd_name == INFO_CMD and args.expand)
|
|
128
|
+
config = Config(args, expand)
|
|
129
|
+
if config.main_cmd == RUN_CMD:
|
|
130
|
+
return run_test_list(config)
|
|
131
|
+
elif config.main_cmd == LIST_CMD:
|
|
132
|
+
list_tests(config)
|
|
133
|
+
elif config.main_cmd == GROUPS_CMD:
|
|
134
|
+
list_groups(config)
|
|
135
|
+
elif config.main_cmd == INFO_CMD:
|
|
136
|
+
show_test_info(config)
|
|
137
|
+
elif config.main_cmd == DUMP_CONFIG_CMD:
|
|
138
|
+
dump_config(config)
|
|
139
|
+
elif config.main_cmd == DUMP_XTEST_CMD:
|
|
140
|
+
dump_test(args.test_name, config)
|
|
141
|
+
|
|
142
|
+
except XeetException as e:
|
|
143
|
+
log_error(f"xeet: {e}", pr=True, file=sys.stderr)
|
|
144
|
+
return 255
|
|
145
|
+
return 0
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
if __name__ == "__main__":
|
|
149
|
+
exit(xrun())
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# file generated by setuptools_scm
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
TYPE_CHECKING = False
|
|
4
|
+
if TYPE_CHECKING:
|
|
5
|
+
from typing import Tuple, Union
|
|
6
|
+
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
7
|
+
else:
|
|
8
|
+
VERSION_TUPLE = object
|
|
9
|
+
|
|
10
|
+
version: str
|
|
11
|
+
__version__: str
|
|
12
|
+
__version_tuple__: VERSION_TUPLE
|
|
13
|
+
version_tuple: VERSION_TUPLE
|
|
14
|
+
|
|
15
|
+
__version__ = version = '0.5.4.post2'
|
|
16
|
+
__version_tuple__ = version_tuple = (0, 5, 4)
|