mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-07-07 07:46:52 +03:00
fix duplicates file and upload name uniqueness (#17354)
* fix duplicates file name and upload artifact name uniqueness
* test it
* fix
* again
* Revert "test it"
This reverts commit b64956208d
.
* add missing single quotes
This commit is contained in:
parent
2c502dea95
commit
4711c52fcd
4
.github/workflows/test-single.yml
vendored
4
.github/workflows/test-single.yml
vendored
|
@ -112,7 +112,7 @@ jobs:
|
|||
env:
|
||||
CHIA_ROOT: ${{ github.workspace }}/.chia/mainnet
|
||||
CHIA_SIMULATOR_ROOT: ${{ github.workspace }}/.chia/simulator
|
||||
JOB_FILE_NAME: tests_${{ matrix.os.file_name }}_python-${{ matrix.python.file_name }}_${{ matrix.configuration.name }}
|
||||
JOB_FILE_NAME: tests_${{ matrix.os.file_name }}_python-${{ matrix.python.file_name }}_${{ matrix.configuration.module_import_path }}${{ matrix.configuration.file_name_index }}
|
||||
BLOCKS_AND_PLOTS_VERSION: 0.38.0
|
||||
|
||||
steps:
|
||||
|
@ -221,7 +221,7 @@ jobs:
|
|||
env:
|
||||
ENABLE_PYTEST_MONITOR: ${{ matrix.os.matrix == 'ubuntu' && matrix.configuration.enable_pytest_monitor || '' }}
|
||||
run: |
|
||||
pytest --cov=chia --cov=tests --cov-config=.coveragerc --cov-report= -o 'junit_suite_name=${{ env.JOB_FILE_NAME }}' --junitxml=junit-data/junit.${{ env.JOB_FILE_NAME }}.xml --durations=10 ${{ matrix.configuration.pytest_parallel_args[matrix.os.matrix] }} -m "not benchmark" ${{ env.ENABLE_PYTEST_MONITOR }} ${{ matrix.configuration.test_files }}
|
||||
pytest --cov=chia --cov=tests --cov-config=.coveragerc --cov-report= -o 'junit_suite_name=${{ env.JOB_FILE_NAME }}' --junitxml='junit-data/junit.${{ env.JOB_FILE_NAME }}.xml' --durations=10 ${{ matrix.configuration.pytest_parallel_args[matrix.os.matrix] }} -m "not benchmark" ${{ env.ENABLE_PYTEST_MONITOR }} ${{ matrix.configuration.test_files }}
|
||||
|
||||
- name: Move back to chia/ for coverage
|
||||
run: |
|
||||
|
|
|
@ -103,14 +103,14 @@ if len(args.only) == 0:
|
|||
else:
|
||||
test_paths = [root_path.joinpath(path) for path in args.only]
|
||||
|
||||
test_paths = [path for path in test_paths for _ in range(args.duplicates)]
|
||||
test_paths_with_index = [(path, index + 1) for path in test_paths for index in range(args.duplicates)]
|
||||
|
||||
configuration = []
|
||||
|
||||
specified_defaults: Dict[Path, Dict[str, Any]] = {}
|
||||
pytest_monitor_enabling_paths: List[Path] = []
|
||||
|
||||
for path in test_paths:
|
||||
for path, index in test_paths_with_index:
|
||||
if path.is_dir():
|
||||
test_files = sorted(path.glob("test_*.py"))
|
||||
test_file_paths = [file.relative_to(project_root_path) for file in test_files]
|
||||
|
@ -143,6 +143,16 @@ for path in test_paths:
|
|||
|
||||
pytest_monitor_enabling_paths.append(path)
|
||||
|
||||
max_index_characters = len(str(args.duplicates))
|
||||
index_string = f"{index:0{max_index_characters}d}"
|
||||
module_import_path = ".".join(path.relative_to(root_path).with_suffix("").parts)
|
||||
if args.duplicates == 1:
|
||||
name = module_import_path
|
||||
file_name_index = ""
|
||||
else:
|
||||
name = f"{module_import_path} #{index_string}"
|
||||
file_name_index = f"_{index_string}"
|
||||
|
||||
for_matrix = {
|
||||
"check_resource_usage": conf["check_resource_usage"],
|
||||
"enable_pytest_monitor": "-p monitor" if enable_pytest_monitor else "",
|
||||
|
@ -151,8 +161,12 @@ for path in test_paths:
|
|||
"checkout_blocks_and_plots": conf["checkout_blocks_and_plots"],
|
||||
"install_timelord": conf["install_timelord"],
|
||||
"test_files": paths_for_cli,
|
||||
"name": ".".join(path.relative_to(root_path).with_suffix("").parts),
|
||||
"name": name,
|
||||
"legacy_keyring_required": conf.get("legacy_keyring_required", False),
|
||||
"index": index,
|
||||
"index_string": index_string,
|
||||
"module_import_path": module_import_path,
|
||||
"file_name_index": file_name_index,
|
||||
}
|
||||
for_matrix = dict(sorted(for_matrix.items()))
|
||||
configuration.append(for_matrix)
|
||||
|
|
Loading…
Reference in New Issue
Block a user