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: enable windows for testing heartbeat #32937

Merged
merged 9 commits into from
Sep 1, 2022

Conversation

v1v
Copy link
Member

@v1v v1v commented Aug 31, 2022

What does this PR do?

Enable testing for heartbeat on windows.

Why is it important?

It was disabled since some tests were failing, and reported those tests but no further actions were done.

Let's enable back so the @elastic/uptime can figure out what's going on

@v1v v1v added Team:obs-ds-hosted-services Label for the Observability Hosted Services team backport-7.17 Automated backport to the 7.17 branch with mergify backport-v8.4.0 Automated backport with mergify labels Aug 31, 2022
@v1v v1v requested a review from a team as a code owner August 31, 2022 14:15
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Aug 31, 2022
@mergify mergify bot assigned v1v Aug 31, 2022
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Aug 31, 2022
@elasticmachine
Copy link
Collaborator

elasticmachine commented Aug 31, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-08-31T20:44:53.105+0000

  • Duration: 53 min 40 sec

Test stats 🧪

Test Results
Failed 0
Passed 178
Skipped 0
Total 178

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

andrewvc added a commit to andrewvc/beats that referenced this pull request Aug 31, 2022
None of this is supported or works there, so we should just disable it.
Fixes elastic#32937

No release notes necessary since there are no user facing changes
…2939)

None of this is supported or works there, so we should just disable it.
Fixes elastic#32937

No release notes necessary since there are no user facing changes
@v1v v1v reopened this Aug 31, 2022
@v1v
Copy link
Member Author

v1v commented Aug 31, 2022

/test

@andrewvc
Copy link
Contributor

Apologies, I missed some build tags, mind if I push them directly here to make testing them easier?

@v1v
Copy link
Member Author

v1v commented Aug 31, 2022

Yes, please, contribute to this PR if needed 👍

@andrewvc andrewvc requested a review from a team as a code owner August 31, 2022 20:22
@andrewvc andrewvc requested review from belimawr and rdner and removed request for a team August 31, 2022 20:22
@andrewvc
Copy link
Contributor

I hope you don't mind @v1v , I've pushed directly to here to see if I can resolve the test failures with a few more build tags

Copy link
Contributor

@andrewvc andrewvc left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@andrewvc andrewvc left a comment

Choose a reason for hiding this comment

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

Well, that was premature, I thought I'd seen them all passing

@@ -70,30 +69,5 @@ var Scenarios = &ScenarioDB{
}, func() {}, nil
},
},
{
Name: "simple-browser",
Copy link
Contributor

Choose a reason for hiding this comment

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

Temporarily remove browser test from scenarios. This is a very new test that will come
back in an improved form in #30632

Copy link
Contributor

@andrewvc andrewvc left a comment

Choose a reason for hiding this comment

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

LGTM now

@v1v
Copy link
Member Author

v1v commented Sep 1, 2022

I can see some errors in the logs:

[2022-08-31T21:06:34.702Z] >> python test: Unit Testing
[2022-08-31T21:06:59.250Z] ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'C:\\Users\\jenkins\\AppData\\Local\\Temp\\pip-uninstall-deorbl2h\\pip.exe'
[2022-08-31T21:06:59.250Z] Consider using the `--user` option or check the permissions.
[2022-08-31T21:06:59.250Z] 
[2022-08-31T21:07:40.233Z] warn: failed to upgrade pip (ignoring): running "null\build\ve\windows\Scripts\pip install -U pip" failed with exit code 1>> python test: Unit Testing - No tests found.

image

https://beats-ci.elastic.co/blue/organizations/jenkins/Beats%2Fbeats%2FPR-32937/detail/PR-32937/6/pipeline/1446#step-2249-log-15

I just compared with a different build for a different component and similar outcome but in this case it ran some python tests

[2022-08-31T21:42:09.207Z] >> go test: Unit Test Passed
[2022-08-31T21:42:10.580Z] Generated fields.yml for metricbeat to C:\Users\jenkins\workspace\PR-32943-2-f1330a12-3ea8-4829-b203-948c9932e0d3\src\github.com\elastic\beats\x-pack\metricbeat\fields.yml
[2022-08-31T21:42:37.791Z] >> python test: Unit Testing
[2022-08-31T21:43:01.651Z] ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'C:\\Users\\jenkins\\AppData\\Local\\Temp\\pip-uninstall-bdd6i7kv\\pip.exe'
[2022-08-31T21:43:01.651Z] Consider using the `--user` option or check the permissions.
[2022-08-31T21:43:01.651Z] 
[2022-08-31T21:43:43.877Z] warn: failed to upgrade pip (ignoring): running "null\build\ve\windows\Scripts\pip install -U pip" failed with exit code 1============================= test session starts =============================
[2022-08-31T21:43:43.878Z] platform win32 -- Python 3.8.5, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
[2022-08-31T21:43:43.878Z] rootdir: C:\Users\jenkins\workspace\PR-32943-2-f1330a12-3ea8-4829-b203-948c9932e0d3\src\github.com\elastic\beats, configfile: pytest.ini
[2022-08-31T21:43:43.878Z] plugins: otel-1.1.1, rerunfailures-9.1.1, timeout-1.4.2
[2022-08-31T21:43:43.878Z] timeout: 90.0s
[2022-08-31T21:43:43.878Z] timeout method: thread
[2022-08-31T21:43:43.878Z] timeout func_only: True
[2022-08-31T21:43:43.878Z] collected 29 items
[2022-08-31T21:43:43.878Z] 
[2022-08-31T21:43:55.452Z] tests\system\test_xpack_base.py s.....s.                                 [ 27%]

https://beats-ci.elastic.co/blue/organizations/jenkins/Beats%2Fbeats%2FPR-32937/detail/PR-32937/6/pipeline/1446#step-2249-log-15

image

I don't know if those errors are genuine or flaky... and what's the reason the mage test does not fail, any hints?

@v1v
Copy link
Member Author

v1v commented Sep 1, 2022

@andrewvc , what's your feedback for #32937 (comment) ? It's the expected behaviour?

@andrewvc
Copy link
Contributor

andrewvc commented Sep 1, 2022

@v1v that's a bit of a mystery to me TBH, we don't do any python stuff outside of the standard tasks defined in libbeat's mage helpers.

I would have assumed that error would be present for all beats on windows if it's present for us. Are you certain other beats are running mage pythonUnitTest on windows?

Running locally on my win box (which I never normally do) I get a different, but similar error on metricbeat and heartbeat:

[notice] To update, run: C:\Users\AndrewCholakian\projects\beats\build\ve\windows\Scripts\python.exe -m pip install --upgrade pip
                                                                                         cd^C
C:\Users\AndrewCholakian\projects\beats\heartbeat [fix-remaining-win-issues +3 ~0 -0 !]> ^C
C:\Users\AndrewCholakian\projects\beats\heartbeat [fix-remaining-win-issues +3 ~0 -0 !]>
C:\Users\AndrewCholakian\projects\beats\heartbeat [fix-remaining-win-issues +3 ~0 -0 !]>
C:\Users\AndrewCholakian\projects\beats\heartbeat [fix-remaining-win-issues +3 ~0 -0 !]> cd ..\metricbeat
C:\Users\AndrewCholakian\projects\beats\metricbeat [fix-remaining-win-issues +3 ~0 -0 !]> mage pythonUnitTest
Generated fields.yml for metricbeat to C:\Users\AndrewCholakian\projects\beats\metricbeat\fields.yml
Generated fields.yml for metricbeat to C:\Users\AndrewCholakian\projects\beats\metricbeat\fields.yml
>> python test: Unit Testing
ERROR: To modify pip, please run the following command:
C:\Users\AndrewCholakian\projects\beats\build\ve\windows\Scripts\python.exe -m pip install -U pip

[notice] A new release of pip available: 22.2.1 -> 22.2.2
[notice] To update, run: C:\Users\AndrewCholakian\projects\beats\build\ve\windows\Scripts\python.exe -m pip install --upgrade pip
warn: failed to upgrade pip (ignoring): running "C:\Users\AndrewCholakian\projects\beats\build\ve\windows\Scripts\pip install -U pip" failed with exit code 1
[notice] A new release of pip available: 22.2.1 -> 22.2.2
[notice] To update, run: C:\Users\AndrewCholakian\projects\beats\build\ve\windows\Scripts\python.exe -m pip install --upgrade pip
ERROR: Could not find a version that satisfies the requirement pywin32==227; sys_platform == "win32" (from docker) (from versions: 302, 303, 304)
ERROR: No matching distribution found for pywin32==227; sys_platform == "win32"

[notice] A new release of pip available: 22.2.1 -> 22.2.2
[notice] To update, run: C:\Users\AndrewCholakian\projects\beats\build\ve\windows\Scripts\python.exe -m pip install --upgrade pip
Error: running "C:\Users\AndrewCholakian\projects\beats\build\ve\windows\Scripts\pip install --quiet -Ur C:\Users\AndrewCholakian\projects\beats/libbeat/tests/system/requirements.txt" failed with exit code 1

They're both running pip commands.

TBH, I would like to keep those disabled on windows, the value those tests add is minimal, not nearly high enough to justify the maintenance cost, esp. given that we've never had a windows specific bug in many years.

@v1v
Copy link
Member Author

v1v commented Sep 1, 2022

Are you certain other beats are running mage pythonUnitTest on windows?

Yes, with similar outcome but running some tests afterwards, for instance, https://beats-ci.elastic.co/blue/organizations/jenkins/Beats%2Fbeats%2FPR-32937/detail/PR-32937/6/pipeline/1446#step-2249-log-15 for metricbeat

I assume, since it happens for other components it's okey to merge this PR.

Do you want me to do it now?

@andrewvc
Copy link
Contributor

andrewvc commented Sep 1, 2022

Yes, ++ on merging

@v1v v1v merged commit 8552e34 into elastic:main Sep 1, 2022
mergify bot pushed a commit that referenced this pull request Sep 1, 2022
(cherry picked from commit 8552e34)

# Conflicts:
#	x-pack/heartbeat/Jenkinsfile.yml
#	x-pack/heartbeat/monitors/browser/source/project.go
#	x-pack/heartbeat/monitors/browser/source/project_test.go
#	x-pack/heartbeat/monitors/browser/source/source.go
#	x-pack/heartbeat/scenarios/basics_test.go
#	x-pack/heartbeat/scenarios/scenarios.go
mergify bot pushed a commit that referenced this pull request Sep 1, 2022
(cherry picked from commit 8552e34)

# Conflicts:
#	x-pack/heartbeat/monitors/browser/source/source.go
andrewvc added a commit that referenced this pull request Sep 12, 2022
andrewvc added a commit to andrewvc/beats that referenced this pull request Sep 12, 2022
chrisberkhout pushed a commit that referenced this pull request Jun 1, 2023
None of this is supported or works there, so we should just disable it.
Fixes #32937

No release notes necessary since there are no user facing changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-7.17 Automated backport to the 7.17 branch with mergify backport-v8.4.0 Automated backport with mergify Team:obs-ds-hosted-services Label for the Observability Hosted Services team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants