Skip to content

feat: add option to run core integration tests on kind - #493

Merged
lorenzhs merged 4 commits into
mainfrom
fstr/kind-integration-tests
Oct 7, 2026
Merged

lorenzhs merged 4 commits into
mainfrom
fstr/kind-integration-tests

Conversation

@fstr

@fstr fstr commented Mar 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem

  1. The current firebolt-python-sdk integration test suite for core relies on docker-compose. The docker-compose setup is not part of the repository and is instead set up via a reusable GitHub Action. The compose file could be moved into this repository, but the more different cluster variations you want to test with the SDK, the more cumbersome the compose setup gets.
  2. The compose setup is only run once before all integration tests are executed. If a test requires a different setup, the compose must be part of the test driver itself.

Trade Off
Both issues could be resolved while sticking to compose, but we already have a firebolt-core Helm chart published in GHCR, which makes multi-node cluster setups straight forward and undergoes continuous testing. If there are more components released via Helm charts in the future, they can easily be integrated. Kind has the downside that we need to work with kubectl port-forward to reach the core containers, so it's another layer in the test setup.

Implementation

  • Add option to run Firebolt Core tests on a local kind cluster instead of using docker-compose with the goal of phasing out the docker-compose setup. For now, we can run the integration test suite with --run-compose or --run-kind or both. This approach was also chosen to show that there are no breaking changes.
  • Update fixtures to depend on kind_app_setup, as the CORE_URL is only known after we installed the Helm chart and ran kubectl port-forward
  • We set-up a kind cluster with a single Firebolt Core Helm chart installation at the beginning of the integration test suite. All tests run against this installation. This mirrors the docker-compose setup.
    • Add option to do additional customized Helm installations per test function/method. For example a 5 node cluster.

Note

Low Risk
Changes are limited to integration-test harness and CI workflows; production SDK code is untouched, though Core CI behavior shifts away from the reusable setup action.

Overview
Adds in-repo Firebolt Core provisioning for integration tests so CI and local runs no longer depend on the external action-setup-core workflow. Core can be exercised via --run-compose (generated Docker Compose stack, including optional --run-https through nginx + self-signed certs) or --run-kind (session kind cluster + Firebolt Core Helm chart with kubectl port-forward).

tests/integration/conftest.py is reworked around an app_setup fixture that parametrizes backends and injects CORE_URL / related env vars; shared session installs are complemented by @mark.dedicated_core_cluster for per-test clusters (e.g. multi-node). CI integration-tests-core.yml runs Compose HTTP/HTTPS and a new Kind HTTP job; CONTRIBUTING documents the new pytest flags.

Reviewed by Cursor Bugbot for commit f17b65a. Bugbot is set up for automated code reviews on this repo. Configure here.

@fstr

fstr commented Mar 22, 2026

Copy link
Copy Markdown
Contributor Author

The core image and the Helm chart version are still hardcoded. For now the goal is to run and test the integration test suite in the GHA CI.

@fstr
fstr requested a review from a team as a code owner March 22, 2026 12:12
@fstr

fstr commented Mar 22, 2026

Copy link
Copy Markdown
Contributor Author

@fstr
fstr force-pushed the fstr/kind-integration-tests branch from cf1d65f to ce2b080 Compare March 23, 2026 07:58
kop
kop previously approved these changes Mar 23, 2026

@kop kop left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Makes perfect sense!

@fstr
fstr force-pushed the fstr/kind-integration-tests branch 4 times, most recently from 335b823 to 18e9c08 Compare March 23, 2026 09:45
gm42
gm42 previously approved these changes Mar 23, 2026
@fstr
fstr force-pushed the fstr/kind-integration-tests branch 2 times, most recently from 2660188 to 1e5b70a Compare March 25, 2026 07:40
@fstr
fstr force-pushed the fstr/kind-integration-tests branch 2 times, most recently from 297f18d to 29fb2ce Compare March 31, 2026 09:13
@fstr
fstr force-pushed the fstr/kind-integration-tests branch from 29fb2ce to 2579512 Compare March 31, 2026 09:14
@sonarqubecloud

Copy link
Copy Markdown

@fstr
fstr dismissed stale reviews from gm42 and kop via 2579512 June 7, 2026 17:47
Comment thread tests/integration/cluster/base.py Fixed
@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

@lorenzhs
lorenzhs merged commit 33774c8 into main Oct 7, 2026
12 checks passed
@lorenzhs
lorenzhs deleted the fstr/kind-integration-tests branch October 7, 2026 13:57

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f17b65a. Configure here.

marker = request.node.get_closest_marker("dedicated_core_cluster")
if marker and getattr(request, "param", "docker-compose") == "kind":
# Prefer marker args if present, else fallback to indirect param
params = marker.args[0] if marker.args else getattr(request, "param", {})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Dedicated cluster backend selection is broken

High Severity

dedicated_helm_install and dedicated_compose_install read request.param on fixtures that are not parametrized, so getattr always falls back to docker-compose. Dedicated Kind releases never deploy, multi-node Kind tests run against the shared one-node session install, and --run-kind still spins up Compose for every @mark.dedicated_core_cluster test.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f17b65a. Configure here.

except (socket.error, ConnectionRefusedError):
if i == 9:
raise RuntimeError(f"Failed to connect to port-forward on {local_port}")
sleep(1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Port-forward wait never reports failure

Medium Severity

Connection errors in the port-forward readiness loop are caught by the inner except, so the outer handler that sleeps and raises never runs. After a few immediate refusals the function still returns a URL even when no forward is listening, and Kind tests fail later with unrelated connection errors.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f17b65a. Configure here.

],
check=True,
)
subprocess.run(["kubectl", "delete", "ns", setup_data["ns"]], check=True)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Namespace delete ignores kind context

Medium Severity

kubectl delete ns omits --context, unlike the other kubectl/helm calls. If the Kind cluster already exists, setup does not switch the current context, so teardown can delete a namespace on the wrong cluster or fail because the Kind namespace is not visible.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f17b65a. Configure here.

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.

5 participants