Skip to content

Commit

Permalink
Junit 5 + security manager (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
tinder-maxwellelliott authored Oct 4, 2024
1 parent 7692569 commit e98f05e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 56 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ on:
branches: [ master ]

jobs:
test-jre11-bzlmod:
test-jre21-bzlmod:
runs-on: ubuntu-latest
steps:
- name: Setup Java JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '21'
- name: Setup Go environment
uses: actions/setup-go@v5
with:
Expand All @@ -25,14 +25,14 @@ jobs:
- uses: actions/checkout@v4
- name: Run bazel-diff tests
run: ~/go/bin/bazelisk coverage --combined_report=lcov //cli/... --enable_bzlmod=true
test-jre11:
test-jre21:
runs-on: ubuntu-latest
steps:
- name: Setup Java JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '21'
- name: Setup Go environment
uses: actions/setup-go@v5
with:
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Run bazel-diff example script
run: ./bazel-diff-example.sh "$GITHUB_WORKSPACE" ~/go/bin/bazelisk $(git rev-parse HEAD~1) $(git rev-parse HEAD)
deploy:
needs: [test-jre11]
needs: [test-jre21]
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
6 changes: 3 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module(
name = "bazel-diff",
version = "7.2.12",
version = "8.0.0",
compatibility_level = 0,
)

Expand All @@ -18,8 +18,8 @@ bazel_diff_maven.install(
"com.willowtreeapps.assertk:assertk-jvm:0.25",
"info.picocli:picocli:jar:4.6.3",
"io.insert-koin:koin-core-jvm:3.1.6",
"io.insert-koin:koin-test-junit4:3.1.6",
"junit:junit:4.13.2",
"io.insert-koin:koin-test-junit4:4.0.0",
"junit:junit:5.11.2",
"org.apache.commons:commons-pool2:2.11.1",
"org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2",
"org.mockito.kotlin:mockito-kotlin:5.4.0",
Expand Down
10 changes: 5 additions & 5 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 9 additions & 43 deletions cli/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ genrule(
stamp = 1,
)

config_setting(
name = "macos",
constraint_values = [
"@@platforms//os:macos",
],
)

java_binary(
name = "bazel-diff",
jvm_flags = select({
Expand Down Expand Up @@ -51,10 +44,7 @@ kt_jvm_library(

kt_jvm_test(
name = "BuildGraphHasherTest",
jvm_flags = select({
":macos": ["-Djava.security.manager=allow"],
"//conditions:default": [],
}) + [
jvm_flags = ["-Djava.security.manager=allow"] + [
"-Dnet.bytebuddy.experimental=true",
],
test_class = "com.bazel_diff.hash.BuildGraphHasherTest",
Expand All @@ -66,70 +56,49 @@ kt_jvm_test(
data = [
":src/test/kotlin/com/bazel_diff/hash/fixture/foo.ts",
],
jvm_flags = select({
":macos": ["-Djava.security.manager=allow"],
"//conditions:default": [],
}),
jvm_flags = ["-Djava.security.manager=allow"],
test_class = "com.bazel_diff.hash.SourceFileHasherTest",
runtime_deps = [":cli-test-lib"],
)

kt_jvm_test(
name = "CalculateImpactedTargetsInteractorTest",
jvm_flags = select({
":macos": ["-Djava.security.manager=allow"],
"//conditions:default": [],
}),
jvm_flags = ["-Djava.security.manager=allow"],
test_class = "com.bazel_diff.interactor.CalculateImpactedTargetsInteractorTest",
runtime_deps = [":cli-test-lib"],
)

kt_jvm_test(
name = "NormalisingPathConverterTest",
jvm_flags = select({
":macos": ["-Djava.security.manager=allow"],
"//conditions:default": [],
}),
jvm_flags = ["-Djava.security.manager=allow"],
test_class = "com.bazel_diff.cli.converter.NormalisingPathConverterTest",
runtime_deps = [":cli-test-lib"],
)

kt_jvm_test(
name = "OptionsConverterTest",
jvm_flags = select({
":macos": ["-Djava.security.manager=allow"],
"//conditions:default": [],
}),
jvm_flags = ["-Djava.security.manager=allow"],
test_class = "com.bazel_diff.cli.converter.OptionsConverterTest",
runtime_deps = [":cli-test-lib"],
)

kt_jvm_test(
name = "DeserialiseHashesInteractorTest",
jvm_flags = select({
":macos": ["-Djava.security.manager=allow"],
"//conditions:default": [],
}),
jvm_flags = ["-Djava.security.manager=allow"],
test_class = "com.bazel_diff.interactor.DeserialiseHashesInteractorTest",
runtime_deps = [":cli-test-lib"],
)

kt_jvm_test(
name = "BazelRuleTest",
jvm_flags = select({
":macos": ["-Djava.security.manager=allow"],
"//conditions:default": [],
}),
jvm_flags = ["-Djava.security.manager=allow"],
test_class = "com.bazel_diff.bazel.BazelRuleTest",
runtime_deps = [":cli-test-lib"],
)

kt_jvm_test(
name = "E2ETest",
jvm_flags = select({
":macos": ["-Djava.security.manager=allow"],
"//conditions:default": [],
}),
jvm_flags = ["-Djava.security.manager=allow"],
test_class = "com.bazel_diff.e2e.E2ETest",
runtime_deps = [":cli-test-lib"],
)
Expand All @@ -140,10 +109,7 @@ kt_jvm_test(
":src/test/kotlin/com/bazel_diff/io/fixture/correct.json",
":src/test/kotlin/com/bazel_diff/io/fixture/wrong.json",
],
jvm_flags = select({
":macos": ["-Djava.security.manager=allow"],
"//conditions:default": [],
}),
jvm_flags = ["-Djava.security.manager=allow"],
test_class = "com.bazel_diff.io.ContentHashProviderTest",
runtime_deps = [
":cli-test-lib",
Expand Down

0 comments on commit e98f05e

Please sign in to comment.