Skip to content

Commit de454f5

Browse files
authored
Rename CI tests to minimal/extended tests (#1073)
This PR refactors the CI workflows for #935, and run some OpenJDK tests as minimal tests.
1 parent ef2bd6d commit de454f5

File tree

6 files changed

+119
-49
lines changed

6 files changed

+119
-49
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Run OpenJDK tests
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
repo:
7+
type: string
8+
required: true
9+
ref:
10+
type: string
11+
required: true
12+
test-script:
13+
type: string
14+
required: true
15+
16+
jobs:
17+
test:
18+
runs-on: ubuntu-22.04
19+
steps:
20+
- name: Checkout MMTk Core
21+
uses: actions/checkout@v2
22+
with:
23+
path: mmtk-core
24+
- name: Checkout OpenJDK Binding
25+
uses: actions/checkout@v2
26+
with:
27+
repository: ${{ inputs.repo }}
28+
path: mmtk-openjdk
29+
ref: ${{ inputs.ref }}
30+
- name: Use mmtk-core Rust toolchain for bindings
31+
run: |
32+
cp mmtk-core/rust-toolchain mmtk-openjdk/mmtk
33+
- name: Setup
34+
run: |
35+
cd mmtk-openjdk
36+
./.github/scripts/ci-checkout.sh
37+
./.github/scripts/ci-setup.sh
38+
sed -i 's/^mmtk[[:space:]]=/#ci:mmtk=/g' mmtk/Cargo.toml
39+
sed -i 's/^#[[:space:]]mmtk/mmtk/g' mmtk/Cargo.toml
40+
- name: Overwrite MMTk core in openjdk binding
41+
run: |
42+
cp -r mmtk-core mmtk-openjdk/repos/
43+
- name: Test
44+
run: |
45+
cd mmtk-openjdk
46+
export RUST_BACKTRACE=1
47+
./.github/scripts/${{ inputs.test-script }}

.github/workflows/post-review-ci.yml renamed to .github/workflows/extended-tests-bindings.yml

Lines changed: 17 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Binding Tests
1+
name: Extended tests - bindings
22

33
on:
44
pull_request:
@@ -14,15 +14,15 @@ concurrency:
1414
jobs:
1515
# Figure out binding PRs.
1616
binding-refs:
17-
if: contains(github.event.pull_request.labels.*.name, 'PR-testing')
17+
if: contains(github.event.pull_request.labels.*.name, 'PR-extended-testing')
1818
uses: ./.github/workflows/pr-binding-refs.yml
1919
with:
2020
pull_request: ${{ github.event.pull_request.number }}
2121

22-
v8-binding-test:
22+
extended-tests-v8:
2323
runs-on: ubuntu-20.04
2424
needs: binding-refs
25-
if: contains(github.event.pull_request.labels.*.name, 'PR-testing')
25+
if: contains(github.event.pull_request.labels.*.name, 'PR-extended-testing')
2626
steps:
2727
- name: Checkout MMTk Core
2828
uses: actions/checkout@v2
@@ -56,45 +56,19 @@ jobs:
5656
.github/scripts/ci-test.sh
5757
.github/scripts/ci-style.sh
5858
59-
openjdk-binding-test:
60-
runs-on: ubuntu-22.04
59+
extended-tests-openjdk:
6160
needs: binding-refs
62-
if: contains(github.event.pull_request.labels.*.name, 'PR-testing')
63-
steps:
64-
- name: Checkout MMTk Core
65-
uses: actions/checkout@v2
66-
with:
67-
path: mmtk-core
68-
- name: Checkout OpenJDK Binding
69-
uses: actions/checkout@v2
70-
with:
71-
repository: ${{ needs.binding-refs.outputs.openjdk_binding_repo }}
72-
path: mmtk-openjdk
73-
ref: ${{ needs.binding-refs.outputs.openjdk_binding_ref }}
74-
- name: Use mmtk-core Rust toolchain for bindings
75-
run: |
76-
cp mmtk-core/rust-toolchain mmtk-openjdk/mmtk
77-
- name: Setup
78-
run: |
79-
cd mmtk-openjdk
80-
./.github/scripts/ci-checkout.sh
81-
./.github/scripts/ci-setup.sh
82-
sed -i 's/^mmtk[[:space:]]=/#ci:mmtk=/g' mmtk/Cargo.toml
83-
sed -i 's/^#[[:space:]]mmtk/mmtk/g' mmtk/Cargo.toml
84-
- name: Overwrite MMTk core in openjdk binding
85-
run: |
86-
cp -r mmtk-core mmtk-openjdk/repos/
87-
- name: Test
88-
run: |
89-
cd mmtk-openjdk
90-
export RUST_BACKTRACE=1
91-
./.github/scripts/ci-test.sh
92-
./.github/scripts/ci-style.sh
61+
if: contains(github.event.pull_request.labels.*.name, 'PR-extended-testing')
62+
uses: ./.github/workflows/binding-tests-openjdk.yml
63+
with:
64+
repo: ${{ needs.binding-refs.outputs.openjdk_binding_repo }}
65+
ref: ${{ needs.binding-refs.outputs.openjdk_binding_ref }}
66+
test-script: ci-test-extended.sh
9367

94-
jikesrvm-binding-test:
68+
extended-tests-jikesrvm:
9569
runs-on: ubuntu-22.04
9670
needs: binding-refs
97-
if: contains(github.event.pull_request.labels.*.name, 'PR-testing')
71+
if: contains(github.event.pull_request.labels.*.name, 'PR-extended-testing')
9872
steps:
9973
- name: Checkout MMTk Core
10074
uses: actions/checkout@v2
@@ -126,10 +100,10 @@ jobs:
126100
./.github/scripts/ci-test.sh
127101
./.github/scripts/ci-style.sh
128102
129-
julia-binding-test:
103+
extended-tests-julia:
130104
runs-on: ubuntu-22.04
131105
needs: binding-refs
132-
if: contains(github.event.pull_request.labels.*.name, 'PR-testing')
106+
if: contains(github.event.pull_request.labels.*.name, 'PR-extended-testing')
133107
steps:
134108
- name: Checkout MMTk Core
135109
uses: actions/checkout@v2
@@ -168,11 +142,10 @@ jobs:
168142
./.github/scripts/ci-test.sh
169143
./.github/scripts/ci-style.sh
170144
171-
172-
ruby-binding-test:
145+
extended-tests-ruby:
173146
runs-on: ubuntu-22.04
174147
needs: binding-refs
175-
if: contains(github.event.pull_request.labels.*.name, 'PR-testing')
148+
if: contains(github.event.pull_request.labels.*.name, 'PR-extended-testing')
176149
strategy:
177150
fail-fast: true
178151
matrix:

.github/workflows/merge-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
with:
1919
# Ignore some actions (based on what merge_group triggers):
2020
# - this action
21-
# - pre code review checks for stable Rust (we allow them to fail)
21+
# - minimal tests for stable Rust (we allow them to fail)
2222
# - binding tests (it may take long to run)
23-
ignoreActions: "ready-to-merge,check-public-api-changes,pre-code-review-checks/x86_64-unknown-linux-gnu/stable,pre-code-review-checks/i686-unknown-linux-gnu/stable,pre-code-review-checks/x86_64-apple-darwin/stable,v8-binding-test,openjdk-binding-test,jikesrvm-binding-test,julia-binding-test,ruby-binding-test (release),ruby-binding-test (debug)"
23+
ignoreActions: "ready-to-merge,check-public-api-changes,minimal-tests-core/x86_64-unknown-linux-gnu/stable,minimal-tests-core/i686-unknown-linux-gnu/stable,minimal-tests-core/x86_64-apple-darwin/stable,v8-binding-test,openjdk-binding-test,jikesrvm-binding-test,julia-binding-test,ruby-binding-test (release),ruby-binding-test (debug)"
2424
# This action uses API. We have a quota of 1000 per hour.
2525
checkInterval: 600
2626
env:
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Minimal tests - bindings
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
merge_group:
8+
branches:
9+
- master
10+
11+
concurrency:
12+
# Cancels pending runs when a PR gets updated.
13+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
# The workflow will be triggered once a PR is opened, and at that point, we do not have chance to specify which binding repo to use.
18+
# This step allows 2mins before we check comments for binding repos/refs.
19+
grace-period:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- run: sleep 120
23+
24+
# Figure out binding PRs.
25+
binding-refs:
26+
needs: grace-period
27+
uses: ./.github/workflows/pr-binding-refs.yml
28+
with:
29+
pull_request: ${{ github.event.pull_request.number }}
30+
31+
minimal-tests-openjdk:
32+
needs: binding-refs
33+
uses: ./.github/workflows/binding-tests-openjdk.yml
34+
with:
35+
repo: ${{ needs.binding-refs.outputs.openjdk_binding_repo }}
36+
ref: ${{ needs.binding-refs.outputs.openjdk_binding_ref }}
37+
test-script: ci-test-minimal.sh

.github/workflows/pre-review-ci.yml renamed to .github/workflows/minimal-tests-core.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Pre Code Review Checks
1+
name: Minimal tests - mmtk-core
22

33
on:
44
pull_request:
@@ -28,7 +28,7 @@ jobs:
2828
export TEST=`cat rust-toolchain`
2929
echo "array=[\"$MSRV\", \"$TEST\", \"stable\"]" >> $GITHUB_OUTPUT
3030
31-
pre-code-review-checks:
31+
minimal-tests-core:
3232
needs: setup-test-matrix
3333
strategy:
3434
fail-fast: false
@@ -39,7 +39,7 @@ jobs:
3939
- { os: macos-12, triple: x86_64-apple-darwin }
4040
rust: ${{ fromJson(needs.setup-test-matrix.outputs.rust )}}
4141

42-
name: pre-code-review-checks/${{ matrix.target.triple }}/${{ matrix.rust }}
42+
name: minimal-tests-core/${{ matrix.target.triple }}/${{ matrix.rust }}
4343
runs-on: ${{ matrix.target.os }}
4444

4545
steps:

docs/team/ci.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Continuous Integration
2+
3+
## Testing
4+
5+
MMTK core runs CI tests *before* a pull request is merged.
6+
7+
MMTk core sets up two sets of tests, the *minimal tests* and the *extended tests*.
8+
* Minimal tests run unconditionally for every pull request and for every commit. This set of tests aims to finish within half an hour.
9+
This include tests from the `mmtk-core` repo and integration tests from binding repos. Integration tests with a binding in the minimal tests should
10+
focus on testing MMTk core features that is exclusively used for the binding.
11+
* Extended tests only run for a pull request if the pull request is tagged with the label `PR-extended-testing`. This set of tests
12+
may take hours, and usually include integration tests with bindings which run the language implementation's standard test suite
13+
as much as possible.

0 commit comments

Comments
 (0)