-
Notifications
You must be signed in to change notification settings - Fork 4
Enable integration tests again #23
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
Conversation
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.
Left comments to explain the workflow. Merging now to avoid leaking more projects. Fixing the actual tests is left for future work.
[tool.hatch.build.targets.wheel] | ||
packages = ["elasticsearch_serverless"] | ||
|
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.
This is required by a recent Hatch change: pypa/hatch#1113
@@ -36,8 +36,7 @@ spec: | |||
provider_settings: | |||
build_pull_requests: true | |||
build_branches: true | |||
cancel_intermediate_builds: true | |||
cancel_intermediate_builds_branch_filter: '!main' | |||
cancel_intermediate_builds: false |
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.
We don't want to cancel intermediate builds to make sure we always tear down all serverless projects.
# Default environment variables | ||
export PYTHON_VERSION="${PYTHON_VERSION:=3.9}" | ||
export PYTHON_CONNECTION_CLASS="${PYTHON_CONNECTION_CLASS:=urllib3}" | ||
export EC_PROJECT_NAME=$(buildkite-agent meta-data get $EC_PROJECT_PREFIX) |
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.
We retrieve the full project name to be able to tear it down.
echo -e "--- :elasticsearch: Tear down serverless instance $EC_PROJECT_NAME" | ||
run_qaf 'qaf elastic-cloud projects delete' | ||
rm -rf "$(pwd)/cloud.json" |
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.
If we want to use run-tests
locally, we need to tear down properly, hence the condition.
set -eo pipefail | ||
|
||
python3 -m pip install pyyaml | ||
python3 .buildkite/generatesteps.py | buildkite-agent pipeline upload |
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.
Since we need two builds per combination (run-tests and teardown), the matrix functionality does not work and we need to generate the steps.
def benchmark_to_steps(python, connection_class): | ||
return [ | ||
{ | ||
"group": f":elasticsearch: :python: ES Serverless ({python}/{connection_class})", |
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.
A group isn't strictly necessary, but it allows for a nicer summary.
for python in ["3.7", "3.8", "3.9", "3.10", "3.11"]: | ||
for connection_class in ["urllib3", "requests"]: |
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.
This could be in rest-tests.yaml!
No description provided.