Skip to content

Commit 5646e55

Browse files
authored
Merge pull request #2760 from Gedochao/maintenance/it-lts-n-next
Run integration tests with both Scala 3 LTS & Next versions
2 parents afa171a + d105251 commit 5646e55

File tree

93 files changed

+569
-340
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+569
-340
lines changed

.github/workflows/ci.yml

Lines changed: 207 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,31 @@ jobs:
129129
name: test-results-jvm-tests-3
130130
path: test-report.xml
131131

132+
jvm-tests-4:
133+
timeout-minutes: 120
134+
runs-on: "ubuntu-20.04"
135+
steps:
136+
- uses: actions/checkout@v4
137+
with:
138+
fetch-depth: 0
139+
submodules: true
140+
- uses: VirtusLab/scala-cli-setup@5b1a6c5ca98b5642996812781f6ad9b2d5935f85
141+
with:
142+
jvm: "temurin:17"
143+
- name: JVM integration tests
144+
run: ./mill -i integration.test.jvm
145+
env:
146+
SCALA_CLI_IT_GROUP: 4
147+
- name: Convert Mill test reports to JUnit XML format
148+
if: success() || failure()
149+
run: .github/scripts/generate-junit-reports.sc jvm-tests-4 'Scala CLI JVM Tests (4)' test-report.xml out/
150+
- name: Upload test report
151+
uses: actions/upload-artifact@v3
152+
if: success() || failure()
153+
with:
154+
name: test-results-jvm-tests-4
155+
path: test-report.xml
156+
132157
generate-linux-launcher:
133158
timeout-minutes: 120
134159
runs-on: "ubuntu-20.04"
@@ -254,6 +279,39 @@ jobs:
254279
name: test-results-linux-tests-3
255280
path: test-report.xml
256281

282+
native-linux-tests-4:
283+
needs: generate-linux-launcher
284+
timeout-minutes: 120
285+
runs-on: "ubuntu-20.04"
286+
steps:
287+
- uses: actions/checkout@v4
288+
with:
289+
fetch-depth: 0
290+
submodules: true
291+
- uses: VirtusLab/scala-cli-setup@5b1a6c5ca98b5642996812781f6ad9b2d5935f85
292+
with:
293+
jvm: "temurin:17"
294+
- uses: actions/download-artifact@v3
295+
with:
296+
name: linux-launchers
297+
path: artifacts/
298+
- name: Native integration tests
299+
run: ./mill -i nativeIntegrationTests
300+
env:
301+
UPDATE_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
302+
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
303+
SCALA_CLI_IT_GROUP: 4
304+
SCALA_CLI_SODIUM_JNI_ALLOW: false
305+
- name: Convert Mill test reports to JUnit XML format
306+
if: success() || failure()
307+
run: .github/scripts/generate-junit-reports.sc linux-tests-4 'Scala CLI Linux Tests (4)' test-report.xml out/
308+
- name: Upload test report
309+
uses: actions/upload-artifact@v3
310+
if: success() || failure()
311+
with:
312+
name: test-results-linux-tests-4
313+
path: test-report.xml
314+
257315
generate-linux-arm64-native-launcher:
258316
runs-on: "macOS-m1"
259317
if: github.event_name == 'push'
@@ -402,6 +460,39 @@ jobs:
402460
name: test-results-macos-tests-3
403461
path: test-report.xml
404462

463+
native-macos-tests-4:
464+
needs: generate-macos-launcher
465+
timeout-minutes: 120
466+
runs-on: "macOS-13"
467+
steps:
468+
- uses: actions/checkout@v4
469+
with:
470+
fetch-depth: 0
471+
submodules: true
472+
- uses: VirtusLab/scala-cli-setup@5b1a6c5ca98b5642996812781f6ad9b2d5935f85
473+
with:
474+
jvm: "temurin:17"
475+
- uses: actions/download-artifact@v3
476+
with:
477+
name: macos-launchers
478+
path: artifacts/
479+
- name: Native integration tests
480+
run: ./mill -i nativeIntegrationTests
481+
env:
482+
UPDATE_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
483+
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
484+
SCALA_CLI_IT_GROUP: 4
485+
SCALA_CLI_SODIUM_JNI_ALLOW: false
486+
- name: Convert Mill test reports to JUnit XML format
487+
if: success() || failure()
488+
run: .github/scripts/generate-junit-reports.sc macos-tests-4 'Scala CLI MacOS Tests (4)' test-report.xml out/
489+
- name: Upload test report
490+
uses: actions/upload-artifact@v3
491+
if: success() || failure()
492+
with:
493+
name: test-results-macos-tests-4
494+
path: test-report.xml
495+
405496
generate-macos-m1-launcher:
406497
timeout-minutes: 120
407498
runs-on: "macOS-m1"
@@ -619,6 +710,47 @@ jobs:
619710
name: test-results-windows-tests-3
620711
path: test-report.xml
621712

713+
native-windows-tests-4:
714+
needs: generate-windows-launcher
715+
timeout-minutes: 120
716+
runs-on: "windows-2019"
717+
steps:
718+
- uses: actions/checkout@v4
719+
with:
720+
fetch-depth: 0
721+
submodules: true
722+
- name: Set up Python
723+
uses: actions/setup-python@v5
724+
with:
725+
python-version: "3.10"
726+
- uses: VirtusLab/scala-cli-setup@5b1a6c5ca98b5642996812781f6ad9b2d5935f85
727+
with:
728+
jvm: "temurin:17"
729+
- name: Get latest coursier launcher
730+
run: .github/scripts/get-latest-cs.sh
731+
shell: bash
732+
- uses: actions/download-artifact@v3
733+
with:
734+
name: windows-launchers
735+
path: artifacts/
736+
- name: Native integration tests
737+
run: ./mill -i nativeIntegrationTests
738+
env:
739+
COURSIER_JNI: force
740+
UPDATE_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
741+
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
742+
SCALA_CLI_IT_GROUP: 4
743+
SCALA_CLI_SODIUM_JNI_ALLOW: false
744+
- name: Convert Mill test reports to JUnit XML format
745+
if: success() || failure()
746+
run: scala-cli shebang .github/scripts/generate-junit-reports.sc windows-tests-4 'Scala CLI Windows Tests (4)' test-report.xml out/
747+
- name: Upload test report
748+
uses: actions/upload-artifact@v3
749+
if: success() || failure()
750+
with:
751+
name: test-results-windows-tests-4
752+
path: test-report.xml
753+
622754
generate-mostly-static-launcher:
623755
timeout-minutes: 120
624756
runs-on: ubuntu-20.04
@@ -755,6 +887,39 @@ jobs:
755887
name: test-results-native-mostly-static-tests-3
756888
path: test-report.xml
757889

890+
native-mostly-static-tests-4:
891+
needs: generate-mostly-static-launcher
892+
timeout-minutes: 120
893+
runs-on: ubuntu-20.04
894+
steps:
895+
- uses: actions/checkout@v4
896+
with:
897+
fetch-depth: 0
898+
submodules: true
899+
- uses: VirtusLab/scala-cli-setup@5b1a6c5ca98b5642996812781f6ad9b2d5935f85
900+
with:
901+
jvm: "temurin:17"
902+
- uses: actions/download-artifact@v3
903+
with:
904+
name: mostly-static-launchers
905+
path: artifacts/
906+
- name: Native integration tests
907+
run: ./mill -i integration.test.nativeMostlyStatic
908+
env:
909+
UPDATE_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
910+
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
911+
SCALA_CLI_IT_GROUP: 4
912+
SCALA_CLI_SODIUM_JNI_ALLOW: false
913+
- name: Convert Mill test reports to JUnit XML format
914+
if: success() || failure()
915+
run: .github/scripts/generate-junit-reports.sc native-mostly-static-tests-4 'Scala CLI Native Mostly Static Tests (4)' test-report.xml out/
916+
- name: Upload test report
917+
uses: actions/upload-artifact@v3
918+
if: success() || failure()
919+
with:
920+
name: test-results-native-mostly-static-tests-4
921+
path: test-report.xml
922+
758923
generate-static-launcher:
759924
timeout-minutes: 120
760925
runs-on: ubuntu-20.04
@@ -895,6 +1060,41 @@ jobs:
8951060
name: test-results-native-static-tests-3
8961061
path: test-report.xml
8971062

1063+
native-static-tests-4:
1064+
needs: generate-static-launcher
1065+
timeout-minutes: 120
1066+
runs-on: ubuntu-20.04
1067+
steps:
1068+
- uses: actions/checkout@v4
1069+
with:
1070+
fetch-depth: 0
1071+
submodules: true
1072+
- uses: VirtusLab/scala-cli-setup@5b1a6c5ca98b5642996812781f6ad9b2d5935f85
1073+
with:
1074+
jvm: "temurin:17"
1075+
- uses: actions/download-artifact@v3
1076+
with:
1077+
name: static-launchers
1078+
path: artifacts/
1079+
- name: Build docker image
1080+
run: .github/scripts/generate-docker-image.sh
1081+
- name: Native integration tests
1082+
run: ./mill -i integration.test.nativeStatic
1083+
env:
1084+
UPDATE_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1085+
SCALA_CLI_IT_FORCED_LAUNCHER_DIRECTORY: artifacts/
1086+
SCALA_CLI_IT_GROUP: 4
1087+
SCALA_CLI_SODIUM_JNI_ALLOW: false
1088+
- name: Convert Mill test reports to JUnit XML format
1089+
if: success() || failure()
1090+
run: .github/scripts/generate-junit-reports.sc native-static-tests-4 'Scala CLI Native Static Tests (4)' test-report.xml out/
1091+
- name: Upload test report
1092+
uses: actions/upload-artifact@v3
1093+
if: success() || failure()
1094+
with:
1095+
name: test-results-native-static-tests-4
1096+
path: test-report.xml
1097+
8981098
docs-tests:
8991099
# for now, let's run those tests only on ubuntu
9001100
runs-on: ubuntu-20.04
@@ -1039,7 +1239,7 @@ jobs:
10391239
retention-days: 2
10401240

10411241
publish:
1042-
needs: [unit-tests, jvm-tests-1, jvm-tests-2, jvm-tests-3, format, checks, reference-doc]
1242+
needs: [unit-tests, jvm-tests-1, jvm-tests-2, jvm-tests-3, jvm-tests-4, format, checks, reference-doc]
10431243
if: github.event_name == 'push' && github.repository == 'VirtusLab/scala-cli'
10441244
runs-on: ubuntu-20.04
10451245
steps:
@@ -1082,22 +1282,28 @@ jobs:
10821282
- jvm-tests-1
10831283
- jvm-tests-2
10841284
- jvm-tests-3
1285+
- jvm-tests-4
10851286
- native-linux-tests-1
10861287
- native-linux-tests-2
10871288
- native-linux-tests-3
1289+
- native-linux-tests-4
10881290
- native-macos-tests-1
10891291
- native-macos-tests-2
10901292
- native-macos-tests-3
1293+
- native-macos-tests-4
10911294
- native-macos-m1-tests
10921295
- native-windows-tests-1
10931296
- native-windows-tests-2
10941297
- native-windows-tests-3
1298+
- native-windows-tests-4
10951299
- native-mostly-static-tests-1
10961300
- native-mostly-static-tests-2
10971301
- native-mostly-static-tests-3
1302+
- native-mostly-static-tests-4
10981303
- native-static-tests-1
10991304
- native-static-tests-2
11001305
- native-static-tests-3
1306+
- native-static-tests-4
11011307
- vc-redist
11021308
- format
11031309
- checks

build.sc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,7 @@ trait CliIntegration extends SbtModule with ScalaCliPublishModule with HasTests
958958
| def scala212 = "${Scala.scala212}"
959959
| def scala213 = "${Scala.scala213}"
960960
| def scalaSnapshot213 = "${TestDeps.scalaSnapshot213}"
961+
| def scala3LtsPrefix = "${Scala.scala3LtsPrefix}"
961962
| def scala3Lts = "${Scala.scala3Lts}"
962963
| def scala3Next = "${Scala.scala3Next}"
963964
| def defaultScala = "${Scala.defaultUser}"

modules/integration/src/test/scala/scala/cli/integration/BloopTests.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import scala.concurrent.duration.Duration
88
import scala.util.Properties
99

1010
class BloopTests extends ScalaCliSuite {
11-
1211
def runScalaCli(args: String*): os.proc = os.proc(TestUtil.cli, args)
1312

1413
private lazy val bloopDaemonDir =

modules/integration/src/test/scala/scala/cli/integration/BspTestDefinitions.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ import scala.jdk.CollectionConverters.*
2222
import scala.util.control.NonFatal
2323
import scala.util.{Failure, Properties, Success, Try}
2424

25-
abstract class BspTestDefinitions(val scalaVersionOpt: Option[String])
26-
extends ScalaCliSuite with TestScalaVersionArgs {
27-
25+
abstract class BspTestDefinitions extends ScalaCliSuite with TestScalaVersionArgs {
26+
_: TestScalaVersion =>
2827
private lazy val extraOptions = scalaVersionArgs ++ TestUtil.extraOptions
2928

3029
import BspTestDefinitions.*
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
package scala.cli.integration
22

3-
// format: off
4-
class BspTests212 extends BspTestDefinitions(
5-
scalaVersionOpt = Some(Constants.scala212)
6-
)
7-
// format: on
3+
class BspTests212 extends BspTestDefinitions with Test212
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
package scala.cli.integration
22

3-
// format: off
4-
class BspTests213 extends BspTestDefinitions(
5-
scalaVersionOpt = Some(Constants.scala213)
6-
)
7-
// format: on
3+
class BspTests213 extends BspTestDefinitions with Test213
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package scala.cli.integration
2+
3+
class BspTests3Lts extends BspTestDefinitions with Test3Lts
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
package scala.cli.integration
22

3-
class BspTestsDefault extends BspTestDefinitions(scalaVersionOpt = None)
3+
class BspTestsDefault extends BspTestDefinitions with TestDefault

modules/integration/src/test/scala/scala/cli/integration/CleanTests.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package scala.cli.integration
33
import com.eed3si9n.expecty.Expecty.expect
44

55
class CleanTests extends ScalaCliSuite {
6-
76
override def group: ScalaCliSuite.TestGroup = ScalaCliSuite.TestGroup.First
87

98
test("simple") {

modules/integration/src/test/scala/scala/cli/integration/CompileTestDefinitions.scala

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ import java.io.File
66

77
import scala.cli.integration.util.BloopUtil
88

9-
abstract class CompileTestDefinitions(val scalaVersionOpt: Option[String])
9+
abstract class CompileTestDefinitions
1010
extends ScalaCliSuite
1111
with TestScalaVersionArgs
1212
with CompilerPluginTestDefinitions
13-
with SemanticDbTestDefinitions {
14-
13+
with SemanticDbTestDefinitions { _: TestScalaVersion =>
1514
protected lazy val extraOptions: Seq[String] = scalaVersionArgs ++ TestUtil.extraOptions
1615

1716
private lazy val bloopDaemonDir = BloopUtil.bloopDaemonDir {
@@ -693,13 +692,9 @@ abstract class CompileTestDefinitions(val scalaVersionOpt: Option[String])
693692
)
694693
.call(cwd = root, check = false, mergeErrIntoOut = true)
695694
expect(res.exitCode == 1)
696-
assertNoDiff(
697-
res.out.text(),
698-
"""Error occurred during initialization of VM
699-
|Too small maximum heap
700-
|Compilation failed
701-
|""".stripMargin
702-
)
695+
val out = res.out.text()
696+
expect(out.contains("Error occurred during initialization of VM"))
697+
expect(out.contains("Too small maximum heap"))
703698
}
704699
}
705700
}

0 commit comments

Comments
 (0)