-
Notifications
You must be signed in to change notification settings - Fork 148
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
Add serverless beats tests #3658
Merged
fearful-symmetry
merged 110 commits into
elastic:main
from
fearful-symmetry:add-beats-tests-to-serverless
Nov 20, 2023
Merged
Changes from all commits
Commits
Show all changes
110 commits
Select commit
Hold shift + click to select a range
c55bbde
cleaning up
fearful-symmetry 12ac235
Merge remote-tracking branch 'upstream/main' into serverless-tests
fearful-symmetry e939383
final bit of cleanup
fearful-symmetry 2afe998
fix magefile, cleanup docs
fearful-symmetry 413c0d7
clean up errors, make linter happy
fearful-symmetry a16767d
fix headers
fearful-symmetry 7e8970a
fix fields in runner config
fearful-symmetry 9e26b7c
add dashboard checks
fearful-symmetry 3aab6e6
Merge remote-tracking branch 'upstream/main' into serverless-tests
fearful-symmetry 369f62e
clean up, refactor
fearful-symmetry 0b7afae
clean up
fearful-symmetry ef23b3a
tinker with env vars
fearful-symmetry a20930d
fix defaults in fixture
fearful-symmetry 7d5da83
check binary name in test setup
fearful-symmetry e75b495
Merge remote-tracking branch 'upstream/main' into serverless-tests
fearful-symmetry 85b4ba5
allow ilm override in tests
fearful-symmetry 0051120
fix filebeat tests, add cleanup
fearful-symmetry fd88bf2
tinker with dashboards
fearful-symmetry ec9c8c5
fix ilm tests
fearful-symmetry e312d0b
Merge remote-tracking branch 'upstream/main' into serverless-tests
fearful-symmetry 27f8814
Merge remote-tracking branch 'upstream/main' into serverless-tests
fearful-symmetry 5611ff9
Merge remote-tracking branch 'origin/serverless-tests' into serverles…
fearful-symmetry 8267e47
use API keys for auth
fearful-symmetry a733070
Merge remote-tracking branch 'origin/serverless-tests' into serverles…
fearful-symmetry acff625
add additional integration tests
fearful-symmetry 3196a39
Merge remote-tracking branch 'upstream/main' into serverless-tests
fearful-symmetry a79b814
Merge remote-tracking branch 'upstream/main' into serverless-tests
fearful-symmetry de89941
remove beats-specific code
fearful-symmetry 6a5277b
hack in serverless tests
fearful-symmetry a5039e6
tinker with tests
fearful-symmetry 5a49c56
change env var naming
fearful-symmetry 918fec6
actually use correct provisioner name
fearful-symmetry 459206a
tinker with buildkite again
fearful-symmetry a7c0c0a
Merge remote-tracking branch 'upstream/main' into support-serverless-…
fearful-symmetry d158d76
fix things after refactor
fearful-symmetry b2e4e87
fix buildkite
fearful-symmetry f359ef0
fix my bash scripts
fearful-symmetry bf3e5f4
my bash is a tad rusty
fearful-symmetry 1e00bd0
tinker with script hooks
fearful-symmetry 203491c
not sure what ci role I broke
fearful-symmetry 0903608
Merge remote-tracking branch 'upstream/main' into support-serverless-…
fearful-symmetry 875bbd1
clean up es handlers
fearful-symmetry c1cadb1
Merge remote-tracking branch 'upstream/main' into support-serverless-…
fearful-symmetry 2b0d84d
deal with recent refactor
fearful-symmetry 8c07f05
fix my broken refactor
fearful-symmetry 9edc32c
change url, see what happens
fearful-symmetry 0c7d0cb
Merge remote-tracking branch 'upstream/main' into support-serverless-…
fearful-symmetry ea4d684
Merge remote-tracking branch 'upstream/main' into support-serverless-…
fearful-symmetry 4fe9a58
Merge remote-tracking branch 'upstream/main' into support-serverless-…
fearful-symmetry c3c8255
tinker with tests more
fearful-symmetry 0a0ea06
swap pipelines, see what happens
fearful-symmetry d9b62c0
Merge remote-tracking branch 'upstream/main' into support-serverless-…
fearful-symmetry 4165bdb
break apart beat runners
fearful-symmetry 1194e06
create test
fearful-symmetry c09e3f6
add more tests
fearful-symmetry bf89a85
override tests in progress
fearful-symmetry 6dc7c94
finish overwrite tests
fearful-symmetry 421e35f
still adding tests
fearful-symmetry ee2a073
Merge remote-tracking branch 'upstream/main' into add-beats-tests-to-…
fearful-symmetry 99ac425
cleanup
fearful-symmetry a7f4383
fix env var names
fearful-symmetry d62781c
fix filebeat setup, test names
fearful-symmetry 27f1701
fixing up filebeat
fearful-symmetry a590d3b
use templates, fix ES query
fearful-symmetry 38775b1
tinker with buildkite
fearful-symmetry ac2d445
still tinkering
fearful-symmetry 587def0
still trying to get it to work
fearful-symmetry 3e0eb23
still trying to get it to work
fearful-symmetry 94b3961
add script, see what happens
fearful-symmetry d8f17aa
tinkering with script
fearful-symmetry 5cf68f5
tinkering with script
fearful-symmetry e9d8404
trying to diagnose buildkite
fearful-symmetry 03d3705
still fighting with buildkite
fearful-symmetry 18523dc
still trying to get it to work
fearful-symmetry 8da7a0b
set workspace
fearful-symmetry 40bea83
change workspace
fearful-symmetry 4ad1f14
change workspace, again
fearful-symmetry 77186df
change workspace, again
fearful-symmetry c6ce641
trying to debug buildkite
fearful-symmetry 537c81f
Merge remote-tracking branch 'upstream/main' into add-beats-tests-to-…
fearful-symmetry 03aabf9
add debug statements
fearful-symmetry 48d6c5a
run mage twice
fearful-symmetry 04d501d
I swear I'll figure this out
fearful-symmetry a81c543
potential script install issue?
fearful-symmetry 75437d9
use different condition for if block
fearful-symmetry 6bd9190
fix potential wrong flag in setup scripts
fearful-symmetry cdf67cf
change -p flag
fearful-symmetry a9ed68c
fix workspace path, add tests,remove debug code
fearful-symmetry 478e357
use proper env vars
fearful-symmetry 2bf8b9d
fix mage call, directories
fearful-symmetry 860829c
set working directories
fearful-symmetry 1c522ff
now trying to get auth working
fearful-symmetry c55b000
change name to make setup happy
fearful-symmetry f4f69ea
disable cleanup
fearful-symmetry 1ad5919
re-enable cleanup
fearful-symmetry 4823f2b
run one test at a time
fearful-symmetry ff33974
refactor, run filebeat
fearful-symmetry 9664cb3
move function def
fearful-symmetry 882bc6e
fix if blocks
fearful-symmetry af010c5
fix test run, add support for auditbeat and packetbeat
fearful-symmetry e5e7b69
add packetbeat support, run auditbeat tests
fearful-symmetry 2b8f099
add serverless buildkite logic
fearful-symmetry 97a60d4
add more documentation
fearful-symmetry b86305e
Merge remote-tracking branch 'upstream/main' into add-beats-tests-to-…
fearful-symmetry 8454892
Merge remote-tracking branch 'upstream/main' into add-beats-tests-to-…
fearful-symmetry 72567f4
Merge remote-tracking branch 'upstream/main' into add-beats-tests-to-…
fearful-symmetry 48d7ea2
Merge remote-tracking branch 'upstream/main' into add-beats-tests-to-…
fearful-symmetry 374cc74
Merge remote-tracking branch 'upstream/main' into add-beats-tests-to-…
fearful-symmetry fac8582
Merge remote-tracking branch 'upstream/main' into add-beats-tests-to-…
fearful-symmetry 5cef809
fix up tests
fearful-symmetry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
#========================= | ||
# NOTE: This entire script is a temporary hack until we have buildkite set up on the beats repo. | ||
# until then, we need some kind of serverless integration tests, hence this script, which just clones the beats repo, | ||
# and runs the serverless integration suite against different beats | ||
# After buildkite is set up on beats, this file/PR should be reverted. | ||
#========================== | ||
|
||
source .buildkite/scripts/common.sh | ||
STACK_PROVISIONER="${1:-"serverless"}" | ||
|
||
run_test_for_beat(){ | ||
local beat_name=$1 | ||
|
||
#build | ||
export WORKSPACE="build/beats/x-pack/${beat_name}" | ||
SNAPSHOT=true PLATFORMS=linux/amd64 PACKAGES=tar.gz,zip mage package | ||
|
||
#run | ||
export AGENT_BUILD_DIR="build/beats/x-pack/${beat_name}/build/distributions" | ||
export WORKSPACE=$(pwd) | ||
|
||
set +e | ||
TEST_INTEG_CLEAN_ON_EXIT=true TEST_PLATFORMS="linux/amd64" STACK_PROVISIONER="$STACK_PROVISIONER" SNAPSHOT=true mage integration:testBeatServerless $beat_name | ||
TESTS_EXIT_STATUS=$? | ||
set -e | ||
|
||
return $TESTS_EXIT_STATUS | ||
} | ||
#run mage before setup, since this will install go and mage | ||
#the setup scripts will do a few things that assume we're running out of elastic-agent and will break things for beats, so run before we do actual setup | ||
mage -l | ||
|
||
mkdir -p build | ||
cd build | ||
|
||
git clone --filter=tree:0 [email protected]:elastic/beats.git | ||
cd .. | ||
|
||
# export WORKSPACE=beats/x-pack/metricbeat | ||
|
||
# SNAPSHOT=true PLATFORMS=linux/amd64,windows/amd64 PACKAGES=tar.gz,zip mage package | ||
|
||
|
||
# cd .. | ||
|
||
# export AGENT_BUILD_DIR=build/beats/x-pack/metricbeat/build/distributions | ||
# export WORKSPACE=$(pwd) | ||
|
||
# set +e | ||
# TEST_INTEG_CLEAN_ON_EXIT=true TEST_PLATFORMS="linux/amd64" STACK_PROVISIONER="$STACK_PROVISIONER" SNAPSHOT=true mage integration:testBeatServerless metricbeat | ||
# TESTS_EXIT_STATUS=$? | ||
# set -e | ||
|
||
# exit $TESTS_EXIT_STATUS | ||
|
||
echo "testing metricbeat..." | ||
run_test_for_beat metricbeat | ||
|
||
|
||
|
||
echo "testing filebeat..." | ||
run_test_for_beat filebeat | ||
|
||
|
||
|
||
echo "testing auditbeat..." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can skip testing auditbeat since our team doesn't maintain it. None of the code we are testing is really Beat specific regardless. |
||
run_test_for_beat auditbeat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the cron schedule controlled? Can you link to it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I was going to add it once the PR was merged, but the control panel for it is here: https://buildkite.com/elastic/elastic-agent/settings/schedules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a link to that as a comment right above this so future us can find it easily