Skip to content

Commit 1390208

Browse files
committed
gh-86275: use pull-through cache
1 parent 4bb6f00 commit 1390208

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

.github/workflows/build.yml

+5
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,11 @@ jobs:
396396
-x test_subprocess \
397397
-x test_signal \
398398
-x test_sysconfig
399+
- uses: actions/upload-artifact@v3
400+
if: always()
401+
with:
402+
name: hypothesis-example-db
403+
path: .hypothesis/examples/
399404

400405

401406
build_asan:

Lib/test/support/hypothesis_helper.py

+22
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
13
try:
24
import hypothesis
35
except ImportError:
@@ -11,3 +13,23 @@
1113
suppress_health_check=[hypothesis.HealthCheck.too_slow],
1214
)
1315
hypothesis.settings.load_profile("slow-is-ok")
16+
17+
# For local development, we'll write to the default on-local-disk database
18+
# of failing examples, and also use a pull-through cache to automatically
19+
# replay any failing examples discovered in CI. For details on how this
20+
# works, see https://hypothesis.readthedocs.io/en/latest/database.html
21+
if "CI" not in os.environ:
22+
from hypothesis.database import (
23+
GitHubArtifactDatabase,
24+
MultiplexedDatabase,
25+
ReadOnlyDatabase,
26+
)
27+
28+
hypothesis.settings.register_profile(
29+
"cpython-local-dev",
30+
database=MultiplexedDatabase(
31+
hypothesis.settings.default.database,
32+
ReadOnlyDatabase(GitHubArtifactDatabase("python", "cpython")),
33+
),
34+
)
35+
hypothesis.settings.load_profile("cpython-local-dev")

0 commit comments

Comments
 (0)