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

[ci] Make tests pass in Jenkinsfile pipeline #17071

Merged
merged 5 commits into from
Mar 24, 2020

Conversation

andrewkroh
Copy link
Member

@andrewkroh andrewkroh commented Mar 17, 2020

What does this PR do?

  • Fix/skip two failing tests. One in functionbeat and one in metricbeat.
  • Use mage unitTest on Windows. Make sure each project where mage is invoked directly has this in their magefile.go.
  • Fix up some of the environment variables in the Jenkinsfile.
  • Disable macOS stages because we're missing python3 for the moment.

Why is it important?

This will get the Jenkins pipeline build to green. After that we can enable it for all master branch changes and all PRs to master. And then continue to iterate on improving it as we migrate all projects to have a mage build.

@andrewkroh andrewkroh added the ci label Mar 17, 2020
@andrewkroh andrewkroh mentioned this pull request Mar 23, 2020
5 tasks
@andrewkroh andrewkroh force-pushed the bugfix-jenkinsfile-pipeline-1 branch from 248cff6 to a1ca995 Compare March 23, 2020 21:06
@andrewkroh andrewkroh changed the title [ci] Fix PATH in Windows stages in Jenkinsfile [ci] Make tests pass in Jenkinsfile pipeline Mar 23, 2020
@andrewkroh andrewkroh marked this pull request as ready for review March 24, 2020 01:36
@andrewkroh andrewkroh requested a review from a team as a code owner March 24, 2020 01:36
@andrewkroh andrewkroh force-pushed the bugfix-jenkinsfile-pipeline-1 branch from 61322a5 to c52cc74 Compare March 24, 2020 01:48
@andrewkroh
Copy link
Member Author

@kvch Would you mind reviewing the magefile changes in the PR? I think they are all in 53be4a9.

@andrewkroh andrewkroh requested a review from kvch March 24, 2020 01:59
Copy link
Contributor

@kuisathaverat kuisathaverat left a comment

Choose a reason for hiding this comment

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

LGTM

Windows will invoke `mage unitTest` that will run the Go and Python tests without requiring the integration tests environment.

Use an alias for goTestUnit in metricbeat
The full test output is written to a file and we archive that. Additionally if a test fails that output is still logged out stderr.

This helps speed things up because Jenkins doesn't need to deal with streaming megabytes of log output to the console.
It also makes it easier to spot errors in the log.
Changes:

- Disable macOS by default. These workers don't have python3 so they cannot a portion of the tests.
- Add python38 to the PATH on Windows.
- Various fixes to the environment variables on Windows.
- Always add the GVM GOROOT/bin to the PATH on POSIX. Same as was being done on Windows.
- Use bat instead of sh on Windows to run `mage dumpVariables`.
@andrewkroh andrewkroh force-pushed the bugfix-jenkinsfile-pipeline-1 branch from c52cc74 to 8df830b Compare March 24, 2020 14:06
@andrewkroh andrewkroh merged commit df1ebf7 into elastic:master Mar 24, 2020
andrewkroh added a commit to andrewkroh/beats that referenced this pull request Mar 25, 2020
* Address failing tests and warnings

* Ensure mage unitTest works consistently

Windows will invoke `mage unitTest` that will run the Go and Python tests without requiring the integration tests environment.

Use an alias for goTestUnit in metricbeat

* Only include test output when `mage -v` is used

The full test output is written to a file and we archive that. Additionally if a test fails that output is still logged out stderr.

This helps speed things up because Jenkins doesn't need to deal with streaming megabytes of log output to the console.
It also makes it easier to spot errors in the log.

* Jenkinsfile updates

Changes:

- Disable macOS by default. These workers don't have python3 so they cannot a portion of the tests.
- Add python38 to the PATH on Windows.
- Various fixes to the environment variables on Windows.
- Always add the GVM GOROOT/bin to the PATH on POSIX. Same as was being done on Windows.
- Use bat instead of sh on Windows to run `mage dumpVariables`.

* Add MAGEFILE_VERBOSE to travis-ci env
andrewkroh added a commit that referenced this pull request Mar 25, 2020
* Backport Jenkinsfile and supporting scripts

Files are from b82b9db

* [ci] Make tests pass in Jenkinsfile pipeline (#17071)

* Address failing tests and warnings

* Ensure mage unitTest works consistently

Windows will invoke `mage unitTest` that will run the Go and Python tests without requiring the integration tests environment.

Use an alias for goTestUnit in metricbeat

* Only include test output when `mage -v` is used

The full test output is written to a file and we archive that. Additionally if a test fails that output is still logged out stderr.

This helps speed things up because Jenkins doesn't need to deal with streaming megabytes of log output to the console.
It also makes it easier to spot errors in the log.

* Jenkinsfile updates

Changes:

- Disable macOS by default. These workers don't have python3 so they cannot a portion of the tests.
- Add python38 to the PATH on Windows.
- Various fixes to the environment variables on Windows.
- Always add the GVM GOROOT/bin to the PATH on POSIX. Same as was being done on Windows.
- Use bat instead of sh on Windows to run `mage dumpVariables`.

* Add MAGEFILE_VERBOSE to travis-ci env
andrewkroh added a commit to andrewkroh/beats that referenced this pull request Mar 25, 2020
* Backport Jenkinsfile and supporting scripts

Files are from b82b9db

* [ci] Make tests pass in Jenkinsfile pipeline (elastic#17071)

* Address failing tests and warnings

* Ensure mage unitTest works consistently

Windows will invoke `mage unitTest` that will run the Go and Python tests without requiring the integration tests environment.

Use an alias for goTestUnit in metricbeat

* Only include test output when `mage -v` is used

The full test output is written to a file and we archive that. Additionally if a test fails that output is still logged out stderr.

This helps speed things up because Jenkins doesn't need to deal with streaming megabytes of log output to the console.
It also makes it easier to spot errors in the log.

* Jenkinsfile updates

Changes:

- Disable macOS by default. These workers don't have python3 so they cannot a portion of the tests.
- Add python38 to the PATH on Windows.
- Various fixes to the environment variables on Windows.
- Always add the GVM GOROOT/bin to the PATH on POSIX. Same as was being done on Windows.
- Use bat instead of sh on Windows to run `mage dumpVariables`.

* Add MAGEFILE_VERBOSE to travis-ci env

(cherry picked from commit 0a171b5)
andrewkroh added a commit that referenced this pull request Mar 26, 2020
* Backport Jenkinsfile and supporting scripts

Files are from b82b9db

* [ci] Make tests pass in Jenkinsfile pipeline (#17071)

* Address failing tests and warnings

* Ensure mage unitTest works consistently

Windows will invoke `mage unitTest` that will run the Go and Python tests without requiring the integration tests environment.

Use an alias for goTestUnit in metricbeat

* Only include test output when `mage -v` is used

The full test output is written to a file and we archive that. Additionally if a test fails that output is still logged out stderr.

This helps speed things up because Jenkins doesn't need to deal with streaming megabytes of log output to the console.
It also makes it easier to spot errors in the log.

* Jenkinsfile updates

Changes:

- Disable macOS by default. These workers don't have python3 so they cannot a portion of the tests.
- Add python38 to the PATH on Windows.
- Various fixes to the environment variables on Windows.
- Always add the GVM GOROOT/bin to the PATH on POSIX. Same as was being done on Windows.
- Use bat instead of sh on Windows to run `mage dumpVariables`.

* Add MAGEFILE_VERBOSE to travis-ci env

(cherry picked from commit 0a171b5)
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…stic#17252)

* Backport Jenkinsfile and supporting scripts

Files are from ae26cea

* [ci] Make tests pass in Jenkinsfile pipeline (elastic#17071)

* Address failing tests and warnings

* Ensure mage unitTest works consistently

Windows will invoke `mage unitTest` that will run the Go and Python tests without requiring the integration tests environment.

Use an alias for goTestUnit in metricbeat

* Only include test output when `mage -v` is used

The full test output is written to a file and we archive that. Additionally if a test fails that output is still logged out stderr.

This helps speed things up because Jenkins doesn't need to deal with streaming megabytes of log output to the console.
It also makes it easier to spot errors in the log.

* Jenkinsfile updates

Changes:

- Disable macOS by default. These workers don't have python3 so they cannot a portion of the tests.
- Add python38 to the PATH on Windows.
- Various fixes to the environment variables on Windows.
- Always add the GVM GOROOT/bin to the PATH on POSIX. Same as was being done on Windows.
- Use bat instead of sh on Windows to run `mage dumpVariables`.

* Add MAGEFILE_VERBOSE to travis-ci env

(cherry picked from commit 1de4267)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants