Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate SysV init tests from bats to java packaging #51077

Merged
merged 5 commits into from
Jan 27, 2020

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Jan 15, 2020

This commit converts the sysv init tests from bats tests into the java
packaging tests. Since it is the last oss specific test, the bats oss
test task is also removed.

relates #46005

This commit converts the sysv init tests from bats tests into the java
packaging tests. Since it is the last oss specific test, the bats oss
test task is also removed.

relates elastic#46005
@rjernst rjernst added >test Issues or PRs that are addressing/adding tests :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts v8.0.0 v7.7.0 labels Jan 15, 2020
@elasticmachine
Copy link
Collaborator

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

@rjernst rjernst requested a review from nik9000 January 15, 2020 22:56
public static void filterDistros() {
assumeTrue("rpm or deb", distribution.isPackage());
assumeTrue(Platforms.isSysVInit());
assumeTrue(Platforms.isSystemd());
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this check?

Copy link
Member Author

Choose a reason for hiding this comment

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

It actually should be assumeFalse. This is necessary because some systems have both sysv init and systemd, where sysv commands are a thin layer over systemd. This assume is meant to ensure we only test on systems with true sysv init support. Without it the tests will fail as we are testing behavior specifically in our init.d script, which would not be run in the hybrid systems.

sh.run("service elasticsearch stop");
}

public void assertStatus(int code, String msg) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this used?

Copy link
Member Author

Choose a reason for hiding this comment

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

Leftover from a previous iteration. Removed.

Copy link
Member

@nik9000 nik9000 left a comment

Choose a reason for hiding this comment

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

I found on thing that looks like it needs updating. Otherwise I think this is good.


@Override
public void startElasticsearch() throws Exception {
// since some systems have both sysv and systemd, we need to be explicit here to use sysv
Copy link
Member

Choose a reason for hiding this comment

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

I looks like we skip this when systemd is around.

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed this comment is out of date. I do like being more epxlicit here and using the service calls directly , rather than relying on the parent class to decide to use sysv.

Copy link
Contributor

@pugnascotia pugnascotia left a comment

Choose a reason for hiding this comment

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

LGTM apart from the out-of-date comment.

@rjernst rjernst merged commit b9c98c3 into elastic:master Jan 27, 2020
@rjernst rjernst deleted the distro_tests38 branch January 27, 2020 18:46
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Jan 27, 2020
This commit converts the sysv init tests from bats tests into the java
packaging tests. Since it is the last oss specific test, the bats oss
test task is also removed.

relates elastic#46005
rjernst added a commit that referenced this pull request Feb 10, 2020
This commit converts the sysv init tests from bats tests into the java
packaging tests. Since it is the last oss specific test, the bats oss
test task is also removed.

relates #46005
@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/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts Team:Delivery Meta label for Delivery team >test Issues or PRs that are addressing/adding tests v7.7.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants