Skip to content

Conversation

@rjernst
Copy link
Member

@rjernst rjernst commented Oct 9, 2019

The global build info plugin prints high level information about the
build, including the test seed. However, BuildPlugin sets up the test
seed, which creates an odd implicit dependency on it. This commit moves
the intialization of the testSeed property into the global build info.

The global build info plugin prints high level information about the
build, including the test seed. However, BuildPlugin sets up the test
seed, which creates an odd implicit dependency on it. This commit moves
the intialization of the testSeed property into the global build info.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Build)

Copy link
Contributor

@mark-vieira mark-vieira left a comment

Choose a reason for hiding this comment

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

One comment, otherwise LGTM.

File compilerJavaHome = findCompilerJavaHome();
File runtimeJavaHome = findRuntimeJavaHome(compilerJavaHome);

String testSeedProperty = System.getProperty("tests.seed");
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like this could be simplified to something like this which seems easier to grok:

String testSeed = System.getProperty("tests.seed", generateSeed());

private static String generateSeed() {
    double seed = new Random().nextLong();
    return Long.toUnsignedString(seed, 16).toUpperCase(Locale.ROOT);
}

Copy link
Member Author

Choose a reason for hiding this comment

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

That would mean always generating seed, even when one is passed in as a property. If you are adamant about that, I'll let you make that change with the other refactorings to global build info we discussed.

@rjernst rjernst merged commit 55f4988 into elastic:master Oct 9, 2019
rjernst added a commit that referenced this pull request Oct 9, 2019
The global build info plugin prints high level information about the
build, including the test seed. However, BuildPlugin sets up the test
seed, which creates an odd implicit dependency on it. This commit moves
the intialization of the testSeed property into the global build info.
@rjernst rjernst deleted the build_test_seed branch October 9, 2019 17:14
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Delivery/Build Build or test infrastructure >refactoring Team:Delivery Meta label for Delivery team v7.5.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants