Files
Miancheng Lin 96eda0b5c7 feat(controller): reject selecting a deprecated or uninstalled release (#2129)
A release marked spec.lifecycle.deprecated was only hidden from the
release list and from upgrade targets; creating a cluster or node pool
that named it still succeeded. A release that was not installed was
accepted too, and its nodes then retried provisioning without limit.

Reject both with a 400 at create time, and on a PATCH that switches a
node pool or control plane to such a release. Resending the release a
pool or control plane already runs is still accepted, so it stays
patchable.

Signed-off-by: Miancheng Lin <mianchengl@nvidia.com>
2026-11-05 12:13:40 -08:00
..

Integration Tests

The tests in this directory run against an existing deployment of NVKE. They exercise high level, end-to-end cluster lifecycle workflows in a black-box-like manner. The primary goal of these tests is to sanity check basic functionality as versions of dependent software rev. These tests are expensive in the sense that they use actual forge instances and take a long time to run (hours)

Running the tests

Before you begin you need a test environment and usable forge instances. Currently the tests only interact with the CWE API and allow you to configure the test cluster however you want. This means you can point the tests at any deployment of NVKE (local, site-hosted, hybrid or other) and utilize forge resources from any site. The request files under testdata/default describe a cluster with a single cp node and a 1 node worker node pool, which the tests provision, scale and then tear down. Their site, VPC, subnet and instance-type IDs are placeholders (00000000-0000-4000-8000-...): real Forge identifiers are internal and are not kept in this repository (hack/internal-config-check.sh enforces this). A live run must supply its own request files:

  • Copy the two files under testdata/default outside the repository and replace every Forge identifier with the target site's -- the placeholder site, VPC, subnet and instance-type IDs in both files, and nico.orgID, which carries a dev default rather than a placeholder. Also set nico.release in both files to a release installed on the target management cluster; the controller rejects a release that is not installed or is deprecated
  • Establish ssh tunnel to the management cluster
  • Port-forward cloud-workflow-engine service
  • CREATE_CLUSTER_REQUEST_PATH=<copy> CREATE_NODE_POOL_REQUEST_PATH=<copy> go test -tags integration_test -v -timeout=3h (from within this directory)

Configuration

Variable Description Default
NVKE_CONTROLLER_API_URL URL of the controller API. http://localhost:8080/api
CREATE_CLUSTER_REQUEST_PATH Path to JSON file testdata/default/create-cluster-request.json (placeholder IDs; override for a live run)
CREATE_NODE_POOL_REQUEST_PATH Path to JSON file testdata/default/create-nodepool-request.json (placeholder IDs; override for a live run)
SKIP_CLEANUP Don't tear down any provisioned resources false

Example. The live suite sits behind the integration_test build tag, so the tag is not optional: without it go test runs only TestControllerAPIURL, the settings test that the ordinary unit lane runs, and reports success.

export NVKE_CONTROLLER_API_URL=http://<MANAGEMENT_ADDRESS>:8080/api
export CREATE_CLUSTER_REQUEST_PATH=~/nvke-integration/create-cluster-request.json
export CREATE_NODE_POOL_REQUEST_PATH=~/nvke-integration/create-nodepool-request.json
go test -tags integration_test -v -timeout=3h