Skip to content

Commit

Permalink
fix async tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-bli committed Sep 13, 2024
1 parent f548585 commit 7927188
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: precommit test - Open Telemetry
name: precommit test - Nonparallel
on:
push:
branches: [ main ]
Expand Down
20 changes: 10 additions & 10 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lazy val root = (project in file("."))
.configs(CodeVerificationTests)
.configs(JavaAPITests)
.configs(OtherTests)
.configs(OpenTelemetryTests)
.configs(NonparallelTests)
.configs(UDFTests)
.configs(UDTFTests)
.configs(SprocTests)
Expand Down Expand Up @@ -58,17 +58,16 @@ lazy val root = (project in file("."))
// Test / crossPaths := false,
Test / fork := false,
// Test / javaOptions ++= Seq("-Xms1024M", "-Xmx4096M"),
// Test / parallelExecution := false,
// Test Groups
inConfig(CodeVerificationTests)(Defaults.testTasks),
CodeVerificationTests / testOptions += Tests.Filter(isCodeVerification),
inConfig(JavaAPITests)(Defaults.testTasks),
JavaAPITests / testOptions += Tests.Filter(isJavaAPITests),
inConfig(OtherTests)(Defaults.testTasks),
OtherTests / testOptions += Tests.Filter(isRemainingTest),
inConfig(OpenTelemetryTests)(Defaults.testTasks),
OpenTelemetryTests / testOptions += Tests.Filter(isOpenTelemetryTests),
OpenTelemetryTests / parallelExecution := false,
inConfig(NonparallelTests)(Defaults.testTasks),
NonparallelTests / testOptions += Tests.Filter(isNonparallelTests),
NonparallelTests / parallelExecution := false,
inConfig(UDFTests)(Defaults.testTasks),
UDFTests / testOptions += Tests.Filter(isUDFTests),
inConfig(UDTFTests)(Defaults.testTasks),
Expand Down Expand Up @@ -116,10 +115,11 @@ def isCodeVerification(name: String): Boolean = {
}
lazy val CodeVerificationTests = config("CodeVerificationTests") extend Test

def isOpenTelemetryTests(name: String): Boolean = {
name.contains("OpenTelemetry")
// Tests can't be parallely processed
def isNonparallelTests(name: String): Boolean = {
name.contains("OpenTelemetry") || name.contains("AyncJob")
}
lazy val OpenTelemetryTests = config("OpenTelemetryTests") extend Test
lazy val NonparallelTests = config("NonparallelTests") extend Test

def isUDFTests(name: String): Boolean = {
name.contains("UDF")
Expand Down Expand Up @@ -148,7 +148,7 @@ def isJavaAPITests(name: String): Boolean = {
!isUDFTests(name) &&
!isUDTFTests(name) &&
!isSprocTests(name) &&
!isOpenTelemetryTests(name)
!isNonparallelTests(name)
}
lazy val JavaAPITests = config("JavaAPITests") extend Test

Expand All @@ -158,7 +158,7 @@ lazy val JavaAPITests = config("JavaAPITests") extend Test
// other Tests
def isRemainingTest(name: String): Boolean = {
! isCodeVerification(name) &&
! isOpenTelemetryTests(name) &&
! isNonparallelTests(name) &&
! isUDFTests(name) &&
! isUDTFTests(name) &&
! isSprocTests(name) &&
Expand Down

0 comments on commit 7927188

Please sign in to comment.