Skip to content

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

Merged
merged 8 commits into from
Dec 15, 2023
Merged

Enable integration tests again #23

merged 8 commits into from
Dec 15, 2023

Conversation

pquentin
Copy link
Member

No description provided.

Copy link
Member Author

@pquentin pquentin left a 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.

Comment on lines +98 to +100
[tool.hatch.build.targets.wheel]
packages = ["elasticsearch_serverless"]

Copy link
Member Author

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
Copy link
Member Author

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)
Copy link
Member Author

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.

Comment on lines +31 to +33
echo -e "--- :elasticsearch: Tear down serverless instance $EC_PROJECT_NAME"
run_qaf 'qaf elastic-cloud projects delete'
rm -rf "$(pwd)/cloud.json"
Copy link
Member Author

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
Copy link
Member Author

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})",
Copy link
Member Author

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.

Comment on lines +56 to +57
for python in ["3.7", "3.8", "3.9", "3.10", "3.11"]:
for connection_class in ["urllib3", "requests"]:
Copy link
Member Author

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!

@pquentin pquentin merged commit a944abd into main Dec 15, 2023
@pquentin pquentin deleted the reenable-qaf branch December 15, 2023 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant