Skip to content

Commit

Permalink
Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
honnix committed Nov 5, 2024
1 parent 2f6f39c commit 4b6db34
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
2 changes: 2 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,8 @@ dev_maven.install(
"build.buf:protovalidate:0.1.9",
# https://github.com/bazelbuild/rules_jvm_external/issues/1250
"com.github.spotbugs:spotbugs:4.7.0",
# https://github.com/bazelbuild/rules_jvm_external/issues/1267
"org.mockito:mockito-core:pom:3.3.3",
],
fail_if_repin_required = True,
generate_compat_repositories = True,
Expand Down
2 changes: 2 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ maven_install(
"build.buf:protovalidate:0.1.9",
# https://github.com/bazelbuild/rules_jvm_external/issues/1250
"com.github.spotbugs:spotbugs:4.7.0",
# https://github.com/bazelbuild/rules_jvm_external/issues/1267
"org.mockito:mockito-core:pom:3.3.3",
],
fail_if_repin_required = True,
generate_compat_repositories = True,
Expand Down
15 changes: 13 additions & 2 deletions tests/bazel_run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ function test_transitive_dependency_with_type_of_pom {
bazel query @transitive_dependency_with_type_of_pom//:org_javamoney_moneta_moneta_core >> "$TEST_LOG" 2>&1
}

function test_when_both_pom_and_artifact_are_available_jar_artifact_is_present {
function test_when_both_pom_and_jar_artifact_are_available_jar_artifact_is_present {
# The `maven_coordinates` of the target should be set to the coordinates of the jar
# If the `pom` classifier is asked for, something has gone wrong and no results will
# match
Expand All @@ -268,6 +268,16 @@ function test_when_both_pom_and_artifact_are_available_jar_artifact_is_present {
expect_log "@regression_testing_coursier//:com_github_spotbugs_spotbugs"
}

function test_when_both_pom_and_jar_artifact_are_dependencies_jar_artifact_is_present {
# The `maven_coordinates` of the target should be set to the coordinates of the jar
# If both the `jar` and `pom` classifiers are asked for, something has gone wrong and no results
# will match
bazel query 'attr(tags, "org.mockito:mockito-core:3.3.3", @regression_testing_coursier//:org_mockito_mockito_core)' >> "$TEST_LOG" 2>&1

expect_log "@regression_testing_coursier//:org_mockito_mockito_core"
}


TESTS=(
"test_maven_resolution"
"test_dependency_aggregation"
Expand All @@ -286,7 +296,8 @@ TESTS=(
"test_v1_lock_file_format"
"test_dependency_pom_exclusion"
"test_transitive_dependency_with_type_of_pom"
"test_when_both_pom_and_artifact_are_available_jar_artifact_is_present"
"test_when_both_pom_and_jar_artifact_are_available_jar_artifact_is_present"
"test_when_both_pom_and_jar_artifact_are_dependencies_jar_artifact_is_present"
)

function run_tests() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL",
"__INPUT_ARTIFACTS_HASH": 1906932742,
"__RESOLVED_ARTIFACTS_HASH": 1555926687,
"__INPUT_ARTIFACTS_HASH": -1504192575,
"__RESOLVED_ARTIFACTS_HASH": 2071728921,
"artifacts": {
"android.arch.core:common": {
"shasums": {
Expand Down Expand Up @@ -618,9 +618,9 @@
},
"com.nimbusds:nimbus-jose-jwt": {
"shasums": {
"jar": "978cc75ee13ef021e288bf1aa78d8ad9f69cee558119a09a5a64e7fc92085000"
"jar": "388f3fcec4f7ce41557b0271033c978c30f386cc302a6783be181edd599e9dff"
},
"version": "9.41.1"
"version": "9.45"
},
"com.nimbusds:oauth2-oidc-sdk": {
"shasums": {
Expand Down

0 comments on commit 4b6db34

Please sign in to comment.