Skip to content

Commit

Permalink
Add CI and PR jobs for hypothesis
Browse files Browse the repository at this point in the history
  • Loading branch information
pganssle committed Apr 26, 2023
1 parent d39d5ea commit 4586062
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .azure-pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,30 @@ jobs:
dependencies: apt
coverage: true

- job: Ubuntu_Hypothesis_CI_Tests
displayName: Ubuntu CI Tests (Hypothesis)
dependsOn: Prebuild
condition: |
and(
succeeded(),
eq(variables['hypothesis'], 'true'),
eq(dependencies.Prebuild.outputs['tests.run'], 'true'),
notIn(variables['Build.SourceBranchName'], '3.8', '3.9', '3.10', '3.11'),
)

pool:
vmImage: ubuntu-22.04

variables:
testRunTitle: '$(Build.SourceBranchName)-linux-hypothesis'
testRunPlatform: linux-hypothesis
openssl_version: 1.1.1t

steps:
- template: ./posix-steps.yml
parameters:
dependencies: apt
hypothesis: true

- job: Windows_CI_Tests
displayName: Windows CI Tests
Expand Down
23 changes: 23 additions & 0 deletions .azure-pipelines/posix-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,29 @@ steps:
displayName: 'Run patchcheck.py'
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
- ${{ if eq(parameters.hypothesis, 'true') }}:
- script: ./python -m venv hypovenv && ./hypovenv/bin/python -m pip install -U hypothesis
displayName: 'Set up virtual environment'

- script: ./hypovenv/bin/python -m test.pythoninfo
displayName: 'Display build info'

- script: |
$COMMAND -m test \
--fail-env-changed \
-unone, \
--junit-xml=$(build.binariesDirectory)/test-results.xml \
-x test_multiprocessing_fork \
-x test_multiprocessing_forkserver \
-x test_multiprocessing_spawn \
-x test_concurrent_futures
displayName: 'Run tests with hypothesis installed'
env:
${{ if eq(parameters.xvfb, 'true') }}:
COMMAND: xvfb-run ./hypovenv/bin/python
${{ if ne(parameters.xvfb, 'true') }}:
COMMAND: ./hypovenv/bin/python
- task: PublishTestResults@2
displayName: 'Publish Test Results'
Expand Down
27 changes: 27 additions & 0 deletions .azure-pipelines/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,33 @@ jobs:
coverage: true


- job: Ubuntu_Hypothesis_PR_Tests
displayName: Ubuntu PR Tests (Hypothesis)
dependsOn: Prebuild
condition: |
and(
succeeded(),
eq(variables['hypothesis'], 'true'),
eq(dependencies.Prebuild.outputs['tests.run'], 'true'),
notIn(variables['System.PullRequest.targetBranchName'],
'3.8', '3.9', '3.10', '3.11'),
)

pool:
vmImage: ubuntu-22.04

variables:
testRunTitle: '$(Build.SourceBranchName)-linux-hypothesis'
testRunPlatform: linux-hypothesis
openssl_version: 1.1.1t

steps:
- template: ./posix-steps.yml
parameters:
dependencies: apt
hypothesis: true


- job: Windows_PR_Tests
displayName: Windows PR Tests
dependsOn: Prebuild
Expand Down

0 comments on commit 4586062

Please sign in to comment.