Skip to content

Commit 13890c6

Browse files
committed
Remove check/pytest option --actually-quiet
Avoid using `pytest --quiet` which disables pytest-randomly hook that configures consistent seeding for parallel test jobs. Reverts #1825.
1 parent fac9738 commit 13890c6

File tree

4 files changed

+17
-40
lines changed

4 files changed

+17
-40
lines changed

Diff for: .github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ jobs:
159159
- name: Run Quil dependencies
160160
run: docker-compose -f cirq-rigetti/docker-compose.test.yaml up -d
161161
- name: Pytest check
162-
run: check/pytest -n auto --ignore=cirq-core/cirq/contrib --actually-quiet --rigetti-integration
162+
run: check/pytest -n auto --ignore=cirq-core/cirq/contrib --rigetti-integration
163163
- name: Stop Quil dependencies
164164
run: docker-compose -f cirq-rigetti/docker-compose.test.yaml down
165165
build_docs:
@@ -240,7 +240,7 @@ jobs:
240240
- name: Pytest Windows
241241
run: |
242242
source dev_tools/pypath
243-
check/pytest -n auto --ignore=cirq-core/cirq/contrib --actually-quiet
243+
check/pytest -n auto --ignore=cirq-core/cirq/contrib
244244
shell: bash
245245
macos:
246246
name: Pytest MacOS

Diff for: check/pytest

+6-20
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
# Runs pytest on the repository.
55
#
66
# Usage:
7-
# check/pytest [--actually-quiet] [--flags for pytest] [file-paths-relative-to-repo-root]
8-
#
9-
# The --actually-quiet argument filters out any progress output from pytest.
7+
# check/pytest [--flags for pytest] [file-paths-relative-to-repo-root]
108
#
119
# You may specify pytest flags and specific files to test. The file paths
1210
# must be relative to the repository root. If no files are specified, everything
@@ -18,17 +16,12 @@ cd "$(dirname "${BASH_SOURCE[0]}")"
1816
cd "$(git rev-parse --show-toplevel)"
1917

2018
PYTEST_ARGS=()
21-
ACTUALLY_QUIET=""
2219
PARALLEL=""
2320
for arg in "$@"; do
24-
if [[ "${arg}" == "--actually-quiet" ]]; then
25-
ACTUALLY_QUIET=1
26-
else
27-
if [[ "${arg}" == "-n" ]]; then
28-
PARALLEL=1
29-
fi
30-
PYTEST_ARGS+=("${arg}")
21+
if [[ "${arg}" == "-n" ]]; then
22+
PARALLEL=1
3123
fi
24+
PYTEST_ARGS+=("${arg}")
3225
done
3326

3427
if [ -z "${PARALLEL}" ]; then
@@ -41,15 +34,8 @@ if [ "$PYTHON_VERSION" -lt "37" ]; then
4134
PYTEST_ARGS+=("--ignore=cirq-rigetti")
4235
fi
4336

44-
if [ -z "${ACTUALLY_QUIET}" ]; then
45-
pytest "${PYTEST_ARGS[@]}"
46-
RESULT=$?
47-
else
48-
# Filter out lines like "...F....x... [ 42%]", with coloring.
49-
pytest -q --color=yes "${PYTEST_ARGS[@]}" |
50-
perl -nle'print if not m{^(.\[0m)?[\.FEsx]+(.\[36m)?\s+\[\s*\d+%\](.\[0m)?$}'
51-
RESULT=${PIPESTATUS[0]}
52-
fi
37+
pytest "${PYTEST_ARGS[@]}"
38+
RESULT=$?
5339

5440
if [ "$RESULT" = 5 ]; then
5541
echo "[exit 5] No tests collected, but ignored."

Diff for: check/pytest-and-incremental-coverage

+1-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ fi
7171
source dev_tools/pypath
7272

7373
# Run tests while producing coverage files.
74-
check/pytest --actually-quiet \
75-
--cov \
74+
check/pytest --cov \
7675
--cov-config=dev_tools/conf/.coveragerc \
7776
"${PYTEST_ARGS[@]}"
7877
pytest_result=$?

Diff for: dev_tools/bash_scripts_test.py

+8-16
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,7 @@ def test_pytest_and_incremental_coverage_branch_selection(tmpdir_factory):
349349
assert result.returncode == 0
350350
assert result.stdout == (
351351
'INTERCEPTED check/pytest '
352-
'--actually-quiet --cov '
353-
'--cov-config=dev_tools/conf/.coveragerc\n'
352+
'--cov --cov-config=dev_tools/conf/.coveragerc\n'
354353
'The annotate command will be removed in a future version.\n'
355354
'Get in touch if you still use it: [email protected]\n'
356355
'No data to report.\n'
@@ -376,8 +375,7 @@ def test_pytest_and_incremental_coverage_branch_selection(tmpdir_factory):
376375
assert result.returncode == 0
377376
assert result.stdout == (
378377
'INTERCEPTED check/pytest '
379-
'--actually-quiet --cov '
380-
'--cov-config=dev_tools/conf/.coveragerc\n'
378+
'--cov --cov-config=dev_tools/conf/.coveragerc\n'
381379
'The annotate command will be removed in a future version.\n'
382380
'Get in touch if you still use it: [email protected]\n'
383381
'No data to report.\n'
@@ -395,8 +393,7 @@ def test_pytest_and_incremental_coverage_branch_selection(tmpdir_factory):
395393
assert result.returncode == 0
396394
assert result.stdout == (
397395
'INTERCEPTED check/pytest '
398-
'--actually-quiet --cov '
399-
'--cov-config=dev_tools/conf/.coveragerc\n'
396+
'--cov --cov-config=dev_tools/conf/.coveragerc\n'
400397
'The annotate command will be removed in a future version.\n'
401398
'Get in touch if you still use it: [email protected]\n'
402399
'No data to report.\n'
@@ -414,8 +411,7 @@ def test_pytest_and_incremental_coverage_branch_selection(tmpdir_factory):
414411
assert result.returncode == 0
415412
assert result.stdout == (
416413
'INTERCEPTED check/pytest '
417-
'--actually-quiet --cov '
418-
'--cov-config=dev_tools/conf/.coveragerc\n'
414+
'--cov --cov-config=dev_tools/conf/.coveragerc\n'
419415
'The annotate command will be removed in a future version.\n'
420416
'Get in touch if you still use it: [email protected]\n'
421417
'No data to report.\n'
@@ -433,8 +429,7 @@ def test_pytest_and_incremental_coverage_branch_selection(tmpdir_factory):
433429
assert result.returncode == 0
434430
assert result.stdout == (
435431
'INTERCEPTED check/pytest '
436-
'--actually-quiet --cov '
437-
'--cov-config=dev_tools/conf/.coveragerc\n'
432+
'--cov --cov-config=dev_tools/conf/.coveragerc\n'
438433
'The annotate command will be removed in a future version.\n'
439434
'Get in touch if you still use it: [email protected]\n'
440435
'No data to report.\n'
@@ -464,8 +459,7 @@ def test_pytest_and_incremental_coverage_branch_selection(tmpdir_factory):
464459
assert result.returncode == 0
465460
assert result.stdout == (
466461
'INTERCEPTED check/pytest '
467-
'--actually-quiet --cov '
468-
'--cov-config=dev_tools/conf/.coveragerc\n'
462+
'--cov --cov-config=dev_tools/conf/.coveragerc\n'
469463
'The annotate command will be removed in a future version.\n'
470464
'Get in touch if you still use it: [email protected]\n'
471465
'No data to report.\n'
@@ -483,8 +477,7 @@ def test_pytest_and_incremental_coverage_branch_selection(tmpdir_factory):
483477
assert result.returncode == 0
484478
assert result.stdout == (
485479
'INTERCEPTED check/pytest '
486-
'--actually-quiet --cov '
487-
'--cov-config=dev_tools/conf/.coveragerc\n'
480+
'--cov --cov-config=dev_tools/conf/.coveragerc\n'
488481
'The annotate command will be removed in a future version.\n'
489482
'Get in touch if you still use it: [email protected]\n'
490483
'No data to report.\n'
@@ -509,8 +502,7 @@ def test_pytest_and_incremental_coverage_branch_selection(tmpdir_factory):
509502
assert result.returncode == 0
510503
assert result.stdout.startswith(
511504
'INTERCEPTED check/pytest '
512-
'--actually-quiet --cov '
513-
'--cov-config=dev_tools/conf/.coveragerc\n'
505+
'--cov --cov-config=dev_tools/conf/.coveragerc\n'
514506
'The annotate command will be removed in a future version.\n'
515507
'Get in touch if you still use it: [email protected]\n'
516508
'No data to report.\n'

0 commit comments

Comments
 (0)