Skip to content
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

Run Rust tests in CI #9593

Merged
merged 6 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .azure/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@ parameters:
type: string
displayName: "Version of Python to test"

- name: "testRust"
type: boolean

- name: "testQPY"
type: boolean
default: false
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already were setting these values in all places, so this doesn't impact any call sites.

Here, I think it's better to be explicit and make the job author decide what behavior they want.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds fine to me - I originally added the default, but I don't feel strongly about it.


- name: "testImages"
type: boolean
default: false

- name: "installFromSdist"
type: boolean
default: false

jobs:
- job: "Linux_Tests_Python${{ replace(parameters.pythonVersion, '.', '') }}"
displayName: "Test Linux Python ${{ parameters.pythonVersion }}"
displayName: "Test Linux Rust & Python ${{ parameters.pythonVersion }}"
pool: {vmImage: 'ubuntu-latest'}

variables:
Expand All @@ -41,6 +42,12 @@ jobs:
path: .stestr
displayName: "Cache stestr"

- ${{ if eq(parameters.testRust, true) }}:
- bash: |
set -e
cargo test
displayName: "Run Rust tests"

- bash: |
set -e
python -m pip install --upgrade pip setuptools wheel virtualenv
Expand Down Expand Up @@ -94,7 +101,7 @@ jobs:
env:
QISKIT_PARALLEL: FALSE
RUST_BACKTRACE: 1
displayName: 'Run tests'
displayName: 'Run Python tests'

- bash: |
set -e
Expand Down
4 changes: 4 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ stages:
pythonVersion: ${{ version }}
testQPY: false
testImages: false
testRust: false

- template: ".azure/test-macos.yml"
parameters:
Expand Down Expand Up @@ -146,6 +147,7 @@ stages:
- template: ".azure/test-linux.yml"
parameters:
pythonVersion: ${{ parameters.minimumPythonVersion }}
testRust: true
testQPY: true
testImages: false

Expand All @@ -165,6 +167,7 @@ stages:
- template: ".azure/test-linux.yml"
parameters:
pythonVersion: ${{ parameters.maximumPythonVersion }}
testRust: false
testQPY: false
testImages: true
installFromSdist: true
Expand Down Expand Up @@ -193,6 +196,7 @@ stages:
- template: ".azure/test-linux.yml"
parameters:
pythonVersion: ${{ parameters.branchPushPythonVersion }}
testRust: true
testQPY: true
testImages: true

Expand Down