Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ dev_maven.install(
boms = [
"org.seleniumhq.selenium:selenium-bom:4.14.1",
],
index_file = "@rules_jvm_external//tests/custom_maven_install:maven_resolved_index.json",
lock_file = "@rules_jvm_external//tests/custom_maven_install:maven_resolved_install.json",
repositories = [
"https://repo.spring.io/plugins-release/", # Requires auth, but we don't have it
Expand Down Expand Up @@ -513,6 +514,7 @@ dev_maven.install(
boms = [
"com.google.cloud:libraries-bom:26.59.0",
],
index_file = "@rules_jvm_external//tests/custom_maven_install:coursier_resolved_index.json",
lock_file = "@rules_jvm_external//tests/custom_maven_install:coursier_resolved_install.json",
repositories = [
"https://repo1.maven.org/maven2",
Expand Down
27 changes: 26 additions & 1 deletion tests/bazel_run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,14 @@ function test_coursier_resolution_with_boms() {
fi

# should run successfully
bazel run @coursier_resolved_with_boms//:pin >> "$TEST_LOG" 2>&1
REPIN=1 bazel run @coursier_resolved_with_boms//:pin >> "$TEST_LOG" 2>&1

expect_log "Successfully pinned resolved artifacts"

expect_file_is_not_empty "tests/custom_maven_install/coursier_resolved_install.json"

# TODO: Add back in once coursier supports index files
# expect_file_is_not_empty "tests/custom_maven_install/coursier_resolved_index.json"
}

function test_v1_lock_file_format() {
Expand Down Expand Up @@ -293,6 +300,9 @@ function test_maven_resolution() {

# should run successfully
bazel run @maven_resolved_with_boms//:pin >> "$TEST_LOG" 2>&1

expect_file_is_not_empty "tests/custom_maven_install/maven_resolved_install.json"
expect_file_is_not_empty "tests/custom_maven_install/maven_resolved_index.json"
}

function test_transitive_dependency_with_type_of_pom {
Expand Down Expand Up @@ -327,6 +337,9 @@ function test_when_both_pom_and_jar_artifact_are_dependencies_jar_artifact_is_pr
bazel query @regression_testing_gradle//:androidx_compose_foundation_foundation_layout_android >> "$TEST_LOG" 2>&1

expect_log "@regression_testing_gradle//:androidx_compose_foundation_foundation_layout_android"

expect_file_is_not_empty "tests/custom_maven_install/regression_testing_gradle_install.json"
expect_file_is_not_empty "tests/custom_maven_install/regression_testing_gradle_index.json"
}

function test_gradle_metadata_is_resolved_correctly_for_jvm_artifact {
Expand Down Expand Up @@ -415,6 +428,18 @@ function expect_not_in_file() {
return 1
}

function expect_file_is_not_empty() {
local file=$1
if [ ! -f $file ]; then
printf "NOT FOUND: $file (most probably wrong test configuration)\n"
return 1
fi
if [ ! -s $file ]; then
printf "FAILED: $file is empty\n"
return 1
fi
}

function expect_log() {
local pattern=$1
local message=${2:-Expected regexp \""$pattern"\" not found}
Expand Down
Loading