Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ jobs:
run: |
make test-e2e
make test-examples
env:
E2E_KUTTL_SKIP_DELETE: 1

- name: Generate logs on failure
run: ./hack/collectlogs
Expand Down
2 changes: 1 addition & 1 deletion hack/collectlogs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ kubectl get -n orc-system all -o yaml > "$LOG_DIR/orc-resources.yaml"
mkdir "$LOG_DIR/orc-managed-resources"
for crd in config/crd/bases/openstack.k-orc.cloud_*; do
resource=${crd:39:-5}
kubectl get "${resource}" -A -o yaml > "$LOG_DIR/orc-managed-resources/${resource}.yaml"
kubectl get "${resource}.openstack.k-orc.cloud" -A -o yaml > "$LOG_DIR/orc-managed-resources/openstack.k-orc.cloud_${resource}.yaml"
done

sudo find "$LOG_DIR" -type d -exec chmod 0755 {} \;
Expand Down
10 changes: 9 additions & 1 deletion hack/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,18 @@ if [ -n "$E2E_KUTTL_TIMEOUT" ]; then
E2E_KUTTL_TIMEOUT_OPT="--timeout $E2E_KUTTL_TIMEOUT"
fi

# Skip deleting test resources on failure so collectlogs can capture them.
# Set this variable to 1 to skip deletion.
E2E_KUTTL_SKIP_DELETE=${E2E_KUTTL_SKIP_DELETE:-0}
E2E_KUTTL_SKIP_DELETE_OPT=
if [ "$E2E_KUTTL_SKIP_DELETE" == 1 ]; then
E2E_KUTTL_SKIP_DELETE_OPT="--skip-delete"
fi

# Export variables referenced in kuttl tests.
export E2E_EXTERNAL_NETWORK_NAME
export E2E_KUTTL_OSCLOUDS=${PREPARED_OSCLOUDS}
export E2E_KUTTL_CACERT_OPT
export E2E_KUTTL_FLAVOR

kubectl kuttl test $E2E_KUTTL_DIR $E2E_KUTTL_TIMEOUT_OPT --test "$E2E_KUTTL_TEST"
kubectl kuttl test $E2E_KUTTL_DIR $E2E_KUTTL_TIMEOUT_OPT $E2E_KUTTL_SKIP_DELETE_OPT --test "$E2E_KUTTL_TEST"
23 changes: 12 additions & 11 deletions website/docs/development/writing-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,17 +321,18 @@ commands:

We use environment variables to configure how the tests run.

| Variable | Description | Default |
| ----------- | ----------- |----------- |
| `E2E_OSCLOUDS` | Path to clouds.yaml | `/etc/openstack/clouds.yaml` |
| `E2E_CACERT` | Path to a CA certificate (if needed) | |
| `E2E_OPENSTACK_CLOUD_NAME` | Cloud name for regular credentials | `devstack` |
| `E2E_OPENSTACK_ADMIN_CLOUD_NAME` | Cloud name for admin credentials | `devstack-admin-demo` |
| `E2E_EXTERNAL_NETWORK_NAME` | Name of the external network to use | `public` |
| `E2E_KUTTL_DIR` | Run tests from specific directory | |
| `E2E_KUTTL_TEST` | Run a specific kuttl test | |
| `E2E_KUTTL_FLAVOR` | Flavor name to use for tests | `m1.tiny` |
| `E2E_KUTTL_TIMEOUT` | Override default timeout for tests | |
| Variable | Description | Default |
|----------------------------------|-------------------------------------------------|------------------------------|
| `E2E_OSCLOUDS` | Path to clouds.yaml | `/etc/openstack/clouds.yaml` |
| `E2E_CACERT` | Path to a CA certificate (if needed) | |
| `E2E_OPENSTACK_CLOUD_NAME` | Cloud name for regular credentials | `devstack` |
| `E2E_OPENSTACK_ADMIN_CLOUD_NAME` | Cloud name for admin credentials | `devstack-admin-demo` |
| `E2E_EXTERNAL_NETWORK_NAME` | Name of the external network to use | `public` |
| `E2E_KUTTL_DIR` | Run tests from specific directory | |
| `E2E_KUTTL_TEST` | Run a specific kuttl test | |
| `E2E_KUTTL_FLAVOR` | Flavor name to use for tests | `m1.tiny` |
| `E2E_KUTTL_TIMEOUT` | Override default timeout for tests | |
| `E2E_KUTTL_SKIP_DELETE` | Skip deletion of resources created during tests. Set 1 to enable | `0` |

For example, to run the `import-dependency` test from the `subnet` controller:

Expand Down
Loading