Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
schneems committed Jan 22, 2025
1 parent c9642c4 commit 7be0377
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
15 changes: 8 additions & 7 deletions buildpacks/maven/tests/integration/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,18 @@ fn no_internal_maven_options_logging() {
#[test]
#[ignore = "integration test"]
fn descriptive_error_message_on_failed_build() {
TestRunner::default().build(default_build_config("test-apps/app-with-compile-error").expected_pack_result(PackResult::Failure), |context| {
TestRunner::default().build(
default_build_config("test-apps/app-with-compile-error")
.expected_pack_result(PackResult::Failure),
|context| {
assert_contains!(context.pack_stderr, "[INFO] BUILD FAILURE");

assert_contains!(
context.pack_stderr,
"[Error: Unexpected Maven exit code]"
);
assert_contains!(context.pack_stderr, "! ERROR: Unexpected Maven exit code");

assert_contains!(
context.pack_stderr,
"Maven unexpectedly exited with code '1'. The most common reason for this are\nproblems with your application code and/or build configuration."
"Maven unexpectedly exited with code '1'. The most common reason for this are"
);
});
},
);
}
2 changes: 1 addition & 1 deletion buildpacks/maven/tests/integration/settings_xml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fn maven_settings_url_failure() {
|context| {
assert_contains!(
context.pack_stderr,
&format!("You have set MAVEN_SETTINGS_URL to \"{SETTINGS_XML_URL_404}\". We tried to download the file at this\nURL, but the download failed. Please verify that the given URL is correct and try again.")
&format!("You have set MAVEN_SETTINGS_URL to \"{SETTINGS_XML_URL_404}\". We tried to download the file at this")
);

// This error message comes from Maven itself. We don't expect Maven to to be executed at all.
Expand Down
4 changes: 2 additions & 2 deletions buildpacks/maven/tests/integration/versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn with_wrapper_and_unknown_system_properties() {
UNKNOWN_MAVEN_VERSION, &path
)).expected_pack_result(PackResult::Failure),
|context| {
assert_contains!(context.pack_stderr, "[Error: Unsupported Maven version]");
assert_contains!(context.pack_stderr, "! ERROR: Unsupported Maven version");
assert_contains!(context.pack_stderr, &format!("You have defined an unsupported Maven version ({UNKNOWN_MAVEN_VERSION}) in the system.properties file."));
},
);
Expand Down Expand Up @@ -80,7 +80,7 @@ fn without_wrapper_and_unknown_system_properties() {
set_maven_version_app_dir_preprocessor(UNKNOWN_MAVEN_VERSION, &path);
}).expected_pack_result(PackResult::Failure),
|context| {
assert_contains!(context.pack_stderr, "[Error: Unsupported Maven version]");
assert_contains!(context.pack_stderr, "! ERROR: Unsupported Maven version");
assert_contains!(context.pack_stderr, &format!("You have defined an unsupported Maven version ({UNKNOWN_MAVEN_VERSION}) in the system.properties file."));
},
);
Expand Down

0 comments on commit 7be0377

Please sign in to comment.