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

Updated dev guide instructions to work with master #30014

Conversation

matschaffer
Copy link
Contributor

@matschaffer matschaffer commented Jan 26, 2022

filebeat fails (hangs) on 8.0 due to Elasticsearch is too old. so updating to 8.1 as well as fixing up expectations around authentication and ssl.

I've also included a little extra information about how to run the tests, look for logs, and some options (including one that will be added by #30103)

Rel: #29880

filebeat fails (hangs) on 8.0 due to `Elasticsearch is too old.` so updating to 8.1 as well as fixing up expectations around authentication and ssl.
@matschaffer matschaffer self-assigned this Jan 26, 2022
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 26, 2022
@matschaffer matschaffer requested review from jsoriano, ChrsMark and klacabane and removed request for jsoriano January 26, 2022 07:55
@mergify
Copy link
Contributor

mergify bot commented Jan 26, 2022

This pull request does not have a backport label. Could you fix it @matschaffer? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 7./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Jan 26, 2022
@matschaffer matschaffer added docs release-note:dev_docs Contains a Dev Docs section Team:Docs Label for the Observability docs team and removed backport-skip Skip notification from the automated backport with mergify labels Jan 26, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/obs-docs (Team:Docs)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jan 26, 2022
@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Jan 26, 2022
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jan 26, 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

  • Reason: null

  • Start Time: 2022-02-01T02:46:14.532+0000

  • Duration: 22 min 30 sec

  • Commit: 88ba36a

❕ Flaky test report

No test was executed to be analysed.

🤖 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!)

@matschaffer
Copy link
Contributor Author

matschaffer commented Jan 27, 2022

Today I also found out that I could use tail -F build/system-tests/run/test_modules.Test.test_fileset_file_0_elasticsearch/output.log to watch the filebeat logs during system testing.

Might be good to update this to include something like that.

Additionally I'd like to link the modules dev doc to https://www.elastic.co/guide/en/beats/devguide/current/beats-contributing.html#running-testsuite somehow.

Today the "Testing guide" link just points to a stub page. The way I found the module dev guide was through searching Elastic internal slack history for other people learning how to run filebeat system tests.

Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

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

👍

@@ -485,8 +485,10 @@ run.
In order to test the filesets with the sample logs and/or generate the expected output one should run the tests
locally for a specific module, using the following procedure under Filebeat directory:

. Run an Elasticsearch instance locally using docker: `docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:8.0.0-SNAPSHOT`
. Run an Elasticsearch instance locally using docker: `docker run --rm --name elasticsearch -p 9200:9200 -p 9300:9300 -e "ELASTIC_PASSWORD=changeme" -e "discovery.type=single-node" -e "xpack.security.http.ssl.enabled=false" docker.elastic.co/elasticsearch/elasticsearch:8.1.0-SNAPSHOT`
Copy link
Member

Choose a reason for hiding this comment

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

I think the idea of using 8.0.0-SNAPSHOT was to use the snapshot from master. Do you know if there is now any other snapshot following master? Otherwise we may need to update this on every minor release 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like master-SNAPSHOT works. Presumably this will switch to main-SNAPSHOT at some point but we can update when that happens and it should only happen once.

@@ -485,8 +485,10 @@ run.
In order to test the filesets with the sample logs and/or generate the expected output one should run the tests
locally for a specific module, using the following procedure under Filebeat directory:

. Run an Elasticsearch instance locally using docker: `docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:8.0.0-SNAPSHOT`
. Run an Elasticsearch instance locally using docker: `docker run --rm --name elasticsearch -p 9200:9200 -p 9300:9300 -e "ELASTIC_PASSWORD=changeme" -e "discovery.type=single-node" -e "xpack.security.http.ssl.enabled=false" docker.elastic.co/elasticsearch/elasticsearch:8.1.0-SNAPSHOT`
. Create an "admin" user on that Elasticsearch instance: `curl -u elastic:changeme http://localhost:9200/_security/user/admin -X POST -H 'Content-Type: application/json' -d '{"password": "changeme", "roles": ["superuser"]}'`
Copy link
Member

Choose a reason for hiding this comment

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

Would these changes be also needed when running tests in CI? Let's see if this PR passes 🤔 #30012

Copy link
Contributor Author

@matschaffer matschaffer Jan 31, 2022

Choose a reason for hiding this comment

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

You can also run these tests via mage pythonIntegTest TESTING_FILEBEAT_MODULES=elasticsearch which launches a number of docker-compose services and I suspect is where the admin user gets created and that CI is doing something similar.

That flow takes a very long time (15min) and has some local failures, so wasn't practical for module development.

@matschaffer matschaffer mentioned this pull request Jan 31, 2022
3 tasks
@matschaffer matschaffer requested review from ph and ruflin January 31, 2022 06:02
@matschaffer matschaffer added backport-v8.0.0 Automated backport with mergify and removed backport-skip Skip notification from the automated backport with mergify labels Jan 31, 2022
@matschaffer matschaffer added the Team:Integrations Label for the Integrations team label Jan 31, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Integrations)

@matschaffer
Copy link
Contributor Author

@elastic/obs-docs any idea why this fails? IntelliJ is able to resolve the <<testing>> when I have the file open.

What I'm trying to fix is how https://www.elastic.co/guide/en/beats/devguide/current/beats-contributing.html#running-testsuite links to https://www.elastic.co/guide/en/beats/devguide/current/testing.html (part of the packetbeat guide) rather than https://github.com/elastic/beats/blob/8bdc6d2d38c8762582dd27be66dc3053b5e61346/docs/devguide/testing.asciidoc

@matschaffer
Copy link
Contributor Author

Ahhh. I think I got it. I opened elastic/docs#2364 to avoid the stumbling block I hit.

Also I think we need to add @elastic/obs-docs as a writer to https://github.com/elastic/docs - I can't add it as a PR review target which means it lacks repo permissions.

@matschaffer matschaffer merged commit 3ed5763 into elastic:master Feb 1, 2022
@matschaffer matschaffer deleted the devguide-update-filebeat-test-instructions branch February 1, 2022 13:36
mergify bot pushed a commit that referenced this pull request Feb 1, 2022
filebeat fails (hangs) on 8.0 due to `Elasticsearch is too old.` so updating to 8.1 as well as fixing up expectations around authentication, ssl, and information about options and where to find logs.

(cherry picked from commit 3ed5763)
matschaffer added a commit that referenced this pull request Feb 1, 2022
filebeat fails (hangs) on 8.0 due to `Elasticsearch is too old.` so updating to 8.1 as well as fixing up expectations around authentication, ssl, and information about options and where to find logs.

(cherry picked from commit 3ed5763)

Co-authored-by: Mat Schaffer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.0.0 Automated backport with mergify docs release-note:dev_docs Contains a Dev Docs section Team:Docs Label for the Observability docs team Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants