Skip to content

Commit 770f637

Browse files
authored
chore: Use unique artifact names in Java test run (apache#1818)
1 parent 3efcd28 commit 770f637

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed

.github/actions/java-test/action.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@
1818
name: "Java Test"
1919
description: "Run Java tests"
2020
inputs:
21+
artifact_name:
22+
description: "Unique name for uploaded artifacts for this run"
23+
required: true
2124
suites:
22-
description: 'Which test suites to run'
25+
description: 'Which Scalatest test suites to run'
2326
required: false
2427
default: ''
2528
maven_opts:
@@ -79,7 +82,7 @@ runs:
7982
if: failure()
8083
uses: actions/upload-artifact@v4
8184
with:
82-
name: crash-logs-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}
85+
name: crash-logs-${{ inputs.artifact_name }}
8386
path: "**/hs_err_pid*.log"
8487
- name: Debug listing
8588
if: failure()
@@ -93,13 +96,13 @@ runs:
9396
if: failure()
9497
uses: actions/upload-artifact@v4
9598
with:
96-
name: unit-tests-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}
99+
name: unit-tests-${{ inputs.artifact_name }}
97100
path: "**/target/unit-tests.log"
98101
- name: Upload test results
99102
if: ${{ inputs.upload-test-reports == 'true' }}
100103
uses: actions/upload-artifact@v4
101104
with:
102-
name: java-test-reports-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}
105+
name: java-test-reports-${{ inputs.artifact_name }}
103106
path: "**/target/surefire-reports/*.txt"
104107
retention-days: 7 # 1 week for test reports
105108
overwrite: true

.github/workflows/pr_build_linux.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ jobs:
159159
- name: Java test steps
160160
uses: ./.github/actions/java-test
161161
with:
162+
artifact_name: ${{ matrix.os }}-${{ matrix.profile.name }}-${{ matrix.suite.name }}-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}
162163
suites: ${{ matrix.suite.value }}
163164
maven_opts: ${{ matrix.profile.maven_opts }}
164165
scan_impl: ${{ matrix.profile.scan_impl }}

.github/workflows/pr_build_macos.yml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,23 @@ jobs:
4444
macos-aarch64-test:
4545
strategy:
4646
matrix:
47-
java_version: [17]
48-
spark-version: ['3.4', '3.5', '4.0']
49-
scala-version: ['2.13']
47+
os: [macos-14]
48+
49+
# the goal with these profiles is to get coverage of all Java, Scala, and Spark
50+
# versions without testing all possible combinations, which would be overkill
51+
profile:
52+
- name: "Spark 3.4, JDK 11, Scala 2.12"
53+
java_version: "11"
54+
maven_opts: "-Pspark-3.4 -Pscala-2.12"
55+
56+
- name: "Spark 3.5, JDK 17, Scala 2.13"
57+
java_version: "17"
58+
maven_opts: "-Pspark-3.5 -Pscala-2.13"
59+
60+
- name: "Spark 4.0, JDK 17, Scala 2.13"
61+
java_version: "17"
62+
maven_opts: "-Pspark-4.0 -Pscala-2.13"
63+
5064
suite:
5165
- name: "fuzz"
5266
value: |
@@ -94,19 +108,20 @@ jobs:
94108
org.apache.spark.sql.comet.CometTPCDSV2_7_PlanStabilitySuite
95109
org.apache.spark.sql.comet.CometTaskMetricsSuite
96110
fail-fast: false
97-
name: macos-14(Silicon)/ ${{ matrix.java_version }}-spark-${{matrix.spark-version}}-scala-${{matrix.scala-version}} [${{matrix.suite.name}}]
98-
runs-on: macos-14
111+
name: ${{ matrix.os }}/${{ matrix.profile.name }} [${{ matrix.suite.name }}]
112+
runs-on: ${{ matrix.os }}
99113
steps:
100114
- uses: actions/checkout@v4
101115
- name: Setup Rust & Java toolchain
102116
uses: ./.github/actions/setup-macos-builder
103117
with:
104118
rust-version: ${{env.RUST_VERSION}}
105-
jdk-version: ${{ matrix.java_version }}
119+
jdk-version: ${{ matrix.profile.java_version }}
106120
jdk-architecture: aarch64
107121
protoc-architecture: aarch_64
108122
- name: Java test steps
109123
uses: ./.github/actions/java-test
110124
with:
125+
artifact_name: ${{ matrix.os }}-${{ matrix.profile.name }}-${{ matrix.suite.name }}-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}
111126
suites: ${{ matrix.suite.value }}
112-
maven_opts: -Pspark-${{ matrix.spark-version }},scala-${{ matrix.scala-version }}
127+
maven_opts: ${{ matrix.profile.maven_opts }}

0 commit comments

Comments
 (0)