Skip to content

add integration testing#163

Open
JPadovano1483 wants to merge 6 commits into
skupperproject:mainfrom
JPadovano1483:split/kind-integration
Open

add integration testing#163
JPadovano1483 wants to merge 6 commits into
skupperproject:mainfrom
JPadovano1483:split/kind-integration

Conversation

@JPadovano1483

@JPadovano1483 JPadovano1483 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Adds Kind-based end-to-end integration tests for the management stack and backbone site bootstrap. Tests run via Vitest against a local Kind cluster with PostgreSQL, cert-manager, Keycloak, management-controller, Skupper (multi-van), and site-controller. Test coverage is outlined in the README in /tests/integration/kind.

Testing:

  • run pnpm install
  • run pnpm test:integration:local to spin up a Kind cluster, run integration tests, and tear down the cluster; OR
  • manually bring up the cluster and run tests with pnpm cluster:up, pnpm test:integration, and pnpm cluster:down to tear down the cluster

Depends on #161
Part of #126

@JPadovano1483
JPadovano1483 marked this pull request as ready for review July 8, 2026 15:40

@ted-ross ted-ross left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There is a typo in the second bullet in the PR description.

This PR looks very good. I would like Fernando to also provide a review.

@JPadovano1483

Copy link
Copy Markdown
Contributor Author

There is a typo in the second bullet in the PR description.

This PR looks very good. I would like Fernando to also provide a review.

Thanks! I will wait for @fgiorgetti to review before merging.

One question. In the skupper-install script, I used the multi-van router image from the tedlross quay repo. It looks like we swiched to using the main image from the skupper repo? I also pulled all the CRDs from Fernando's repo (I had a recent CRD regression that caused all sorts of issues, so I may have overcompensated by pulling all of them). If either or you wouldn't mind taking a look at those and letting me know what the correct images and CRDs are, that would be great.

It may be worth discussing having a more centralized location for these. The getting-started doc is currently out of sync, so there doesn't seem to really be a great source of truth for what we need to be running.

JPadovano1483 and others added 4 commits July 16, 2026 09:19
End-to-end Vitest specs against a local Kind cluster with Keycloak, cert-manager, Postgres, Skupper, and backbone site bootstrap coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
@JPadovano1483
JPadovano1483 force-pushed the split/kind-integration branch from 6cafe1d to 619a00b Compare July 16, 2026 13:19

@fgiorgetti fgiorgetti left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A few minor comments only, but overall it seems to work well.

I noticed that once I start the kind cluster and immeditally run the integration tests, it is failing 1 test only once, but if I run it again, it passes:

❯ integration tests/integration/kind/specs/backbone-bootstrap.test.js (8 tests | 1 failed) 10203ms
✓ Postgres has backbone site seeded and bootstrapped 414ms
× site-controller deployment is available in site-a 57ms
✓ skupper-router pod is running in site-a 49ms
✓ site-controller startup log markers are present 114ms
✓ GET /api/v1alpha1/hostnames returns manage access point ingress bundle 3031ms
✓ manage access point ingress appears in Postgres after state sync 906ms
✓ manage access-point TLS secret exists in site namespace 112ms
✓ management-controller logs AMQP connection to site manage access point 163ms
✓ integration tests/integration/kind/specs/mgmt-health.test.js (7 tests) 3956ms
✓ Postgres schema tables exist 2260ms
✓ Configuration seed row is present 489ms
✓ ManagementControllers row created on startup 521ms
✓ integration tests/integration/kind/specs/mgmt-auth-api.test.js (6 tests) 1597ms
✓ POST /backbones creates a backbone and DELETE removes it 601ms
✓ integration tests/integration/kind/specs/mgmt-certs.test.js (5 tests) 632ms

Another comment that is not appropriate for this PR, but something for an upcoming enhancement just to keep in mind (like when we enable integration tests to run through the CI), would be to add a test reporter, to write results in JSON/JUnit format. As those resources could be stored so we can compare results against separate runs.

Comment thread tests/integration/helpers/bootstrap.js Outdated
* @param {string} [namespace]
* @param {number} [timeoutMs]
*/
export async function waitForRunningPod(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe move this to kubectl.js

Comment thread tests/integration/helpers/bootstrap.js Outdated
}
try {
const logs = kubectl(
["logs", pod.metadata.name, "-c", "config-init", "--tail=20"],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should it be static to config-init?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This can probably made more general, especially if moved to kube.js. Would the suggestion here be to find any init containers that didn't complete and grab logs from those, rather than hardcoding the config-init container?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Correct. Get the list of initContainer names and eventually iterate through them.

# shellcheck source=../config.sh
source "${ROOT}/config.sh"

echo "Ensuring namespace ${SITE_NAMESPACE}..."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is the purpose of ensuring SITE_NAMESPACE ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Only necessary here in conjunction with the router delete below. This can be moved to the bootstrapping function if the router deletion is removed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Alright, I will leave it up to you.

kubectl --context "${KUBECTL_CONTEXT}" -n "${SKUPPER_NAMESPACE}" rollout status deployment/skupper-controller --timeout=300s

echo "Removing router deployments created with stock kube-adaptor (controller will recreate them)..."
for ns in "${SITE_NAMESPACE}" "${NAMESPACE}"; do

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this clean up really needed here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No this can be removed. I think the only situation where it would do anything would be if you were manually playing around with the cluster and deployed a router with different images. Rerunning cluster:up would ensure they all had the same images afterwards. Probably not a likely edge case though...

@JPadovano1483

Copy link
Copy Markdown
Contributor Author

A few minor comments only, but overall it seems to work well.

I noticed that once I start the kind cluster and immeditally run the integration tests, it is failing 1 test only once, but if I run it again, it passes:

❯ integration tests/integration/kind/specs/backbone-bootstrap.test.js (8 tests | 1 failed) 10203ms ✓ Postgres has backbone site seeded and bootstrapped 414ms × site-controller deployment is available in site-a 57ms ✓ skupper-router pod is running in site-a 49ms ✓ site-controller startup log markers are present 114ms ✓ GET /api/v1alpha1/hostnames returns manage access point ingress bundle 3031ms ✓ manage access point ingress appears in Postgres after state sync 906ms ✓ manage access-point TLS secret exists in site namespace 112ms ✓ management-controller logs AMQP connection to site manage access point 163ms ✓ integration tests/integration/kind/specs/mgmt-health.test.js (7 tests) 3956ms ✓ Postgres schema tables exist 2260ms ✓ Configuration seed row is present 489ms ✓ ManagementControllers row created on startup 521ms ✓ integration tests/integration/kind/specs/mgmt-auth-api.test.js (6 tests) 1597ms ✓ POST /backbones creates a backbone and DELETE removes it 601ms ✓ integration tests/integration/kind/specs/mgmt-certs.test.js (5 tests) 632ms

Another comment that is not appropriate for this PR, but something for an upcoming enhancement just to keep in mind (like when we enable integration tests to run through the CI), would be to add a test reporter, to write results in JSON/JUnit format. As those resources could be stored so we can compare results against separate runs.

Hmm, I think I see why this might be happening, though I haven't been able to replicate the issue.

This is a good suggestion. I'll make note of it in #157

@fgiorgetti
fgiorgetti self-requested a review July 17, 2026 21:16

@fgiorgetti fgiorgetti left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Worked great now.

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.

3 participants