-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
GH-86275: Implementation of hypothesis stubs for property-based tests, with zoneinfo tests #22863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
36049cf
Add stubs for hypothesis tests
pganssle 9bb7f5c
Add property tests for the zoneinfo module
pganssle 840aea1
Add examples to zoneinfo hypothesis tests
pganssle 87c6bdb
Enable settings to operate as a decorator
pganssle c97ec97
Add Phase enum
pganssle cd3ddd7
Make reprs more accurate
pganssle 57a357b
Hard-code ignoring hypothesis files in libregrtest
pganssle 176cc6b
Add news entry
pganssle fd4391c
Add Azure Pipelines CI and PR jobs for hypothesis
pganssle 46cbf7d
Add GHA job to run Hypothesis tests
pganssle 728f5e0
Use independent build stages for hypothesis GHA job
pganssle a305d29
Revert "Add Azure Pipelines CI and PR jobs for hypothesis"
pganssle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use independent build stages for hypothesis GHA job
- Loading branch information
commit 728f5e04e497b6c95c0c94c9ecf230bb0db1d436
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -205,10 +205,7 @@ jobs: | |
| env: | ||
| OPENSSL_VER: 1.1.1t | ||
| PYTHONSTRICTEXTENSIONBUILD: 1 | ||
| RUN_HYPOTHESIS: ${{needs.check_source.outputs.run_hypothesis}} | ||
| steps: | ||
| - name: Print run_hypothesis | ||
| run: echo $RUN_HYPOTHESIS | ||
| - uses: actions/checkout@v3 | ||
| - name: Register gcc problem matcher | ||
| run: echo "::add-matcher::.github/problem-matchers/gcc.json" | ||
|
|
@@ -253,18 +250,9 @@ jobs: | |
| - name: Remount sources writable for tests | ||
| # some tests write to srcdir, lack of pyc files slows down testing | ||
| run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw | ||
| - name: "Create archive of build for other jobs" | ||
| - name: Tests | ||
| working-directory: ${{ env.CPYTHON_BUILDDIR }} | ||
| run: | | ||
| # This complicated invocation is required to get a tarball with the | ||
| # build directory at its root, including all hidden files. | ||
| find . -printf "%P\n" | \ | ||
| tar -czf ${GITHUB_WORKSPACE}/ubuntu-build.tar.gz --no-recursion . -T - | ||
| - name: "Upload artifact for other jobs" | ||
| uses: actions/upload-artifact@v3 | ||
| with: | ||
| name: ubuntu-latest-build | ||
| path: "ubuntu-build.tar.gz" | ||
| run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu" | ||
|
|
||
| build_ubuntu_ssltests: | ||
| name: 'Ubuntu SSL tests with OpenSSL' | ||
|
|
@@ -315,47 +303,63 @@ jobs: | |
| - name: SSL tests | ||
| run: ./python Lib/test/ssltests.py | ||
|
|
||
| test_ubuntu: | ||
| name: "Tests on Ubuntu" | ||
| runs-on: ubuntu-20.04 | ||
| needs: build_ubuntu | ||
| if: needs.check_source.outputs.run_tests == 'true' | ||
| steps: | ||
| - name: Setup directory envs for out-of-tree builds | ||
| run: | | ||
| echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV | ||
| - name: "Download build artifact" | ||
| uses: actions/download-artifact@v3 | ||
| with: | ||
| name: ubuntu-latest-build | ||
| - name: "Unpack build" | ||
| run: | | ||
| mkdir -p ${{ env.CPYTHON_BUILDDIR }} | ||
| tar -xf ubuntu-build.tar.gz -C ${{ env.CPYTHON_BUILDDIR }} | ||
| - name: Tests | ||
| working-directory: ${{ env.CPYTHON_BUILDDIR }} | ||
| run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu" | ||
|
|
||
| test_hypothesis: | ||
| name: "Hypothesis Tests on Ubuntu" | ||
| runs-on: ubuntu-20.04 | ||
| needs: build_ubuntu | ||
| timeout-minutes: 60 | ||
| needs: check_source | ||
| if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true' | ||
| env: | ||
| OPENSSL_VER: 1.1.1t | ||
| PYTHONSTRICTEXTENSIONBUILD: 1 | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Register gcc problem matcher | ||
| run: echo "::add-matcher::.github/problem-matchers/gcc.json" | ||
| - name: Install Dependencies | ||
| run: sudo ./.github/workflows/posix-deps-apt.sh | ||
| - name: Configure OpenSSL env vars | ||
| run: | | ||
| echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV | ||
| echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV | ||
| echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV | ||
| - name: 'Restore OpenSSL build' | ||
| id: cache-openssl | ||
| uses: actions/cache@v3 | ||
| with: | ||
| path: ./multissl/openssl/${{ env.OPENSSL_VER }} | ||
| key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }} | ||
| - name: Install OpenSSL | ||
| if: steps.cache-openssl.outputs.cache-hit != 'true' | ||
| run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux | ||
| - name: Add ccache to PATH | ||
| run: | | ||
| echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV | ||
| - name: Configure ccache action | ||
| uses: hendrikmuhs/[email protected] | ||
| - name: Setup directory envs for out-of-tree builds | ||
| run: | | ||
| echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV | ||
| echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV | ||
| - name: "Download build artifact" | ||
| uses: actions/download-artifact@v3 | ||
| with: | ||
| name: ubuntu-latest-build | ||
| - name: "Unpack build" | ||
| - name: Create directories for read-only out-of-tree builds | ||
| run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR | ||
| - name: Bind mount sources read-only | ||
| run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR | ||
| - name: Configure CPython out-of-tree | ||
| working-directory: ${{ env.CPYTHON_BUILDDIR }} | ||
| run: ../cpython-ro-srcdir/configure --with-pydebug --with-openssl=$OPENSSL_DIR | ||
| - name: Build CPython out-of-tree | ||
| working-directory: ${{ env.CPYTHON_BUILDDIR }} | ||
| run: make -j4 | ||
| - name: Display build info | ||
| working-directory: ${{ env.CPYTHON_BUILDDIR }} | ||
| run: make pythoninfo | ||
| - name: Remount sources writable for tests | ||
| # some tests write to srcdir, lack of pyc files slows down testing | ||
| run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw | ||
| - name: Setup directory envs for out-of-tree builds | ||
| run: | | ||
| mkdir -p ${{ env.CPYTHON_BUILDDIR }} | ||
| tar -xf ubuntu-build.tar.gz -C ${{ env.CPYTHON_BUILDDIR }} | ||
| echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV | ||
| - name: "Create hypothesis venv" | ||
| working-directory: ${{ env.CPYTHON_BUILDDIR }} | ||
| run: | | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.