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

Allow running Java+Ruby tests on Windows separately #15861

Merged

Conversation

dliappis
Copy link
Contributor

@dliappis dliappis commented Jan 26, 2024

Release notes

[rn:skip]

What does this PR do?

This commit allows separate running of Java and Ruby tests on Windows i.e. the same way as we currently do on unix (unit_tests.sh) via a cli argument.
If no argument has been supplied, both tests are run (as it does now).

The wrapper script is also rewritten from old batch style script to powershell.

Why is it important/What is the impact to the user?

It allows us to split the existing Windows CI job in a subsequent PR to separate steps, as we currently do for Linux.

How to test this PR locally

Launch Windows VM using https://github.com/elastic/ingest-dev/blob/main/engineer-productivity/tools/launch_windows_vm.sh
launch powershell.
Git clone this PR and run:

.\ci\unit_tests.ps1 java (or skip the argument to run all)

To simulate a failure you can revert c33afd4

Example successful run on Buildkite:

Simulating a failure:

I temporarily reverted the muted Windows test to verify that a failure bubbles up as a test failure:

Related issues

This commit allows separate running of Java and Ruby tests on Windows
i.e. the same way as we currently do on unix (`unit_tests.sh`)
via a cli argument.

If no argument has been supplied, both tests are run (as it does now).

The wrapper script is also rewritten from old batch style script to
powershell.

Relates elastic#15566
@dliappis dliappis requested review from roaksoax and robbavey January 29, 2024 09:28
@dliappis
Copy link
Contributor Author

This is now ready for review. FYI @robbavey I added you as a reviewer since you seem to have touched this codebase a while ago.

@dliappis dliappis linked an issue Jan 29, 2024 that may be closed by this pull request
Copy link
Contributor

@roaksoax roaksoax left a comment

Choose a reason for hiding this comment

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

lfgtm! just one comment inline.

@@ -38,7 +38,7 @@ def compat_linux_step(imagesuffix: str) -> dict[str, typing.Any]:


def compat_windows_step(imagesuffix: str) -> dict[str, typing.Any]:
windows_command = LiteralScalarString(r'''$$env:WORKSPACE=$$PWD.Path ; .\\ci\\unit_tests.bat''')
windows_command = LiteralScalarString(r'''.\\ci\\unit_tests.ps1''')
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we drop the env variables here? maybe just just $$PWD.Path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's deliberate that we drop WORSPACE because this old env variable was needed by the old bat script.
Regarding using a full path, when BK checks out a repo it cds under the checked out repo, so it's safe to just invoke scripts relatively. We do the same elsewhere in Linux etc.

Copy link

Quality Gate passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No Coverage information No data about Coverage
No Duplication information No data about Duplication

See analysis details on SonarQube

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @dliappis

@dliappis dliappis merged commit 8ac5518 into elastic:main Feb 1, 2024
5 checks passed
@dliappis
Copy link
Contributor Author

dliappis commented Feb 1, 2024

@logstashmachine backport 8.12

@dliappis
Copy link
Contributor Author

dliappis commented Feb 1, 2024

@logstashmachine backport 7.17

github-actions bot pushed a commit that referenced this pull request Feb 1, 2024
This commit allows separate running of Java and Ruby tests on Windows i.e. the same way as we currently do on unix (unit_tests.sh) via a cli argument.
If no argument has been supplied, both tests are run (as it does now).

The wrapper script is also rewritten from old batch style script to Powershell.

This work allows us to split the existing Windows CI job in a subsequent PR to separate steps, as we currently do on Linux.

Relates: #15566
(cherry picked from commit 8ac5518)
github-actions bot pushed a commit that referenced this pull request Feb 1, 2024
This commit allows separate running of Java and Ruby tests on Windows i.e. the same way as we currently do on unix (unit_tests.sh) via a cli argument.
If no argument has been supplied, both tests are run (as it does now).

The wrapper script is also rewritten from old batch style script to Powershell.

This work allows us to split the existing Windows CI job in a subsequent PR to separate steps, as we currently do on Linux.

Relates: #15566
(cherry picked from commit 8ac5518)
dliappis added a commit to dliappis/logstash that referenced this pull request Feb 1, 2024
As a follow up to elastic#15861 this commit splits the current unit tests step
for the Windows JDK matrix pipeline to two that run
Java and Ruby unit tests separately.

Closes elastic#15566
dliappis added a commit that referenced this pull request Feb 1, 2024
This commit allows separate running of Java and Ruby tests on Windows i.e. the same way as we currently do on unix (unit_tests.sh) via a cli argument.
If no argument has been supplied, both tests are run (as it does now).

The wrapper script is also rewritten from old batch style script to Powershell.

This work allows us to split the existing Windows CI job in a subsequent PR to separate steps, as we currently do on Linux.

Relates: #15566
(cherry picked from commit 8ac5518)

Co-authored-by: Dimitrios Liappis <[email protected]>
dliappis added a commit that referenced this pull request Feb 1, 2024
This commit allows separate running of Java and Ruby tests on Windows i.e. the same way as we currently do on unix (unit_tests.sh) via a cli argument.
If no argument has been supplied, both tests are run (as it does now).

The wrapper script is also rewritten from old batch style script to Powershell.

This work allows us to split the existing Windows CI job in a subsequent PR to separate steps, as we currently do on Linux.

Relates: #15566
(cherry picked from commit 8ac5518)

Co-authored-by: Dimitrios Liappis <[email protected]>
dliappis added a commit that referenced this pull request Mar 11, 2024
As a follow up to #15861 this commit splits the current unit tests step
for the Windows JDK matrix pipeline to two that run
Java and Ruby unit tests separately.

Closes #15566
github-actions bot pushed a commit that referenced this pull request Mar 11, 2024
As a follow up to #15861 this commit splits the current unit tests step
for the Windows JDK matrix pipeline to two that run
Java and Ruby unit tests separately.

Closes #15566

(cherry picked from commit c0c213d)
github-actions bot pushed a commit that referenced this pull request Mar 11, 2024
As a follow up to #15861 this commit splits the current unit tests step
for the Windows JDK matrix pipeline to two that run
Java and Ruby unit tests separately.

Closes #15566

(cherry picked from commit c0c213d)
github-actions bot pushed a commit that referenced this pull request Mar 11, 2024
As a follow up to #15861 this commit splits the current unit tests step
for the Windows JDK matrix pipeline to two that run
Java and Ruby unit tests separately.

Closes #15566

(cherry picked from commit c0c213d)
dliappis added a commit that referenced this pull request Mar 11, 2024
As a follow up to #15861 this commit splits the current unit tests step
for the Windows JDK matrix pipeline to two that run
Java and Ruby unit tests separately.

Closes #15566

(cherry picked from commit c0c213d)

Co-authored-by: Dimitrios Liappis <[email protected]>
dliappis added a commit that referenced this pull request Mar 11, 2024
As a follow up to #15861 this commit splits the current unit tests step
for the Windows JDK matrix pipeline to two that run
Java and Ruby unit tests separately.

Closes #15566

(cherry picked from commit c0c213d)

Co-authored-by: Dimitrios Liappis <[email protected]>
dliappis added a commit that referenced this pull request Mar 11, 2024
As a follow up to #15861 this commit splits the current unit tests step
for the Windows JDK matrix pipeline to two that run
Java and Ruby unit tests separately.

Closes #15566

(cherry picked from commit c0c213d)

Co-authored-by: Dimitrios Liappis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split Windows CI JDK Matrix job to Java and Ruby
3 participants