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
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,8 @@ public void testGlobalUpperBoundUpgradeMessage() throws IOException, ParsingExce
String bomUpgradeMessage = globalUpperBoundBomUpgradeNodes.get(0).getValue();
assertThat(bomUpgradeMessage)
.contains(
"Upgrade com.google.protobuf:protobuf-java-util:jar:3.6.1 in the BOM to version \"3.7.1\"");
"Upgrade com.google.protobuf:protobuf-java-util:jar:3.6.1 in the BOM to version"
+ " \"3.7.1\"");

// Case 2: Dependency needs to be updated
Nodes globalUpperBoundDependencyUpgradeNodes =
Expand Down Expand Up @@ -469,7 +470,7 @@ public void testDependencyTrees() throws IOException, ParsingException {
Nodes dependencyTreeParagraph = document.query("//p[@class='dependency-tree-node']");

// characterization test
assertThat(dependencyTreeParagraph).hasSize(38391);
assertThat(dependencyTreeParagraph).hasSize(39649);
Comment on lines -472 to +473

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assertion count changes because now the BOM includes a bit more artifacts.

Assert.assertEquals(
"com.google.protobuf:protobuf-java:jar:3.6.1", dependencyTreeParagraph.get(0).getValue());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
Expand All @@ -38,9 +37,6 @@
import org.eclipse.aether.resolution.ArtifactDescriptorResult;

public final class Bom {

private static final ImmutableSet<String> BOM_SKIP_ARTIFACT_IDS =
ImmutableSet.of("google-cloud-logging-logback", "google-cloud-contrib");

private final ImmutableList<Artifact> artifacts;
private final String coordinates;
Expand Down Expand Up @@ -151,12 +147,7 @@ public static boolean shouldSkipBomMember(Artifact artifact) {
if ("test-jar".equals(type)) {
return true;
}

// TODO remove this hack once we get these out of google-cloud-java's BOM
if (BOM_SKIP_ARTIFACT_IDS.contains(artifact.getArtifactId())) {
return true;
}
Comment on lines -155 to -158

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main change.



return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ public void testBomToPaths_firstElementsAreBomMembers() throws RepositoryExcepti
.isEqualTo("com.google.api:api-common:1.7.0"); // first element in the BOM
int bomSize = managedDependencies.size();
String lastFileName = entries.get(bomSize - 1).toString();
assertThat(lastFileName).isEqualTo("com.google.api:gax-httpjson:0.57.0"); // last element in BOM
assertThat(lastFileName)
.isEqualTo("com.google.code.findbugs:jsr305:3.0.2"); // last element in BOM
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,14 +340,15 @@ public void testWriteExclusionFile_indent()

ExclusionFiles.write(output, linkageErrors);

String actual = new String(Files.readAllBytes(output));
String actual = new String(Files.readAllBytes(output)).replaceAll("\\R", "\n");

String expected =
new String(
Files.readAllBytes(
absolutePathOfResource(
"exclusion-sample-rules/expected-exclusion-output-file.xml")),
StandardCharsets.UTF_8);
Files.readAllBytes(
absolutePathOfResource(
"exclusion-sample-rules/expected-exclusion-output-file.xml")),
StandardCharsets.UTF_8)
.replaceAll("\\R", "\n");
Comment on lines -343 to +351

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Memo: In the new Windows environment, which changed jdk1.8.0_152 to jdk1.8.0_211, the return character was different. This change ignores the difference.


assertEquals(expected, actual);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public void testBom_java8()
LinkageCheckerMain.main(new String[] {"-b", "com.google.cloud:libraries-bom:1.0.0"});
fail("LinkageCheckerMain should throw LinkageCheckResultException upon errors");
} catch (LinkageCheckResultException expected) {
assertEquals("Found 631 linkage errors", expected.getMessage());
assertEquals("Found 734 linkage errors", expected.getMessage());
}

String output = readCapturedStdout();
Expand Down Expand Up @@ -172,7 +172,7 @@ public void testBom_java11()
LinkageCheckerMain.main(new String[] {"-b", "com.google.cloud:libraries-bom:1.0.0"});
fail("LinkageCheckerMain should throw LinkageCheckResultException upon errors");
} catch (LinkageCheckResultException expected) {
assertEquals("Found 653 linkage errors", expected.getMessage());
assertEquals("Found 756 linkage errors", expected.getMessage());
}

String output = readCapturedStdout();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void testReadBom_coordinates() throws ArtifactDescriptorException {
List<Artifact> managedDependencies = bom.getManagedDependencies();
// Characterization test. As long as the artifact doesn't change (and it shouldn't)
// the answer won't change.
Assert.assertEquals(134, managedDependencies.size());
Assert.assertEquals(136, managedDependencies.size());
Assert.assertEquals("com.google.cloud:google-cloud-bom:0.61.0-alpha", bom.getCoordinates());
}

Expand Down
2 changes: 1 addition & 1 deletion kokoro/continuous.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@echo on

set JAVA_HOME=c:\program files\java\jdk1.8.0_152
set JAVA_HOME=c:\program files\java\jdk1.8.0_211

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_152 was not owrking any more.

set PATH=%JAVA_HOME%\bin;%PATH%
set MAVEN_OPTS="-Xmx12g"

Expand Down