Skip to content

Commit 6871391

Browse files
author
CodingWizKid
committed
add e2e test docs
1 parent 3fbac60 commit 6871391

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ html-coverage: out/report.json
5353
out/report.json:
5454
go test -race ./... -coverprofile=out/cover.out --json | tee "$(@)"
5555

56+
test-e2e:
57+
@STACKIT_TOKEN=$(STACKIT_TOKEN) TEST_ZONE_NAME=$(TEST_ZONE_NAME) go test -race -tags=e2e ./... -coverprofile out/cover.out
58+
5659
run:
5760
go run cmd/main.go
5861

e2e_test/README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# End-to-End (E2E) Test Suite
2+
3+
This repository segment encapsulates the comprehensive E2E testing procedures for this project module. It harnesses the `fixture.RunConformance` method to execute conformity verification sequences, ensuring adherence to `cert-manager` established protocols.
4+
5+
## Test Execution Workflow
6+
7+
### Environmental Prerequisite Configuration:
8+
For appropriate test initialization within the STACKIT ecosystem, it is imperative to align the environment with
9+
the predetermined specifications. STACKIT dictates a structural model where a parent project umbrellas various
10+
resource entities, inclusive of DNS zones.
11+
12+
1. **Project Identification Parameterization**:
13+
Configure the unique `project_id` in the [configuration manifest](../testdata/stackit/config.json). Typical configuration appears as:
14+
```json
15+
{
16+
"projectId": "c242332a-ae82-42e2-80e8-eed338fd2b2f",
17+
"authTokenSecretNamespace": "default"
18+
}
19+
```
20+
21+
This instantiation assumes the existence of the specified project, and the associated authentication
22+
token possesses requisite privileges for project and zone access.
23+
2. **Authentication Token Configuration**:
24+
Establish an environment variable for the authentication token, duly vested with CRUD permissions for DNS zones:
25+
```bash
26+
export STACKIT_TOKEN="<your-token>"
27+
```
28+
3. **Zone Initialization**:
29+
Declare the testing DNS zone. Ensure project_id consistency:
30+
```bash
31+
export TEST_ZONE_NAME="test-zone.runs.onstackit.cloud"
32+
```
33+
Invoke the following HTTP request to either instantiate a fresh zone or validate the existing one:
34+
```bash
35+
curl --location "https://dns.api.stackit.cloud/v1/projects/c242332a-ae82-42e2-80e8-eed338fd2b2f/zones" \
36+
--header 'Content-Type: application/json' \
37+
--header "Authorization: Bearer $AUTHENTICATION_TOKEN" \
38+
--data '{
39+
"name": "cert manager e2e test",
40+
"dnsName": "$TEST_ZONE_NAME"
41+
}'
42+
```
43+
Post successful invocation, validate zone ownership. For pre-existing zones, consider a unique zone parameter.
44+
45+
### Environmental Prerequisite Configuration:
46+
With prerequisites addressed, proceed to run the entire E2E test suite:
47+
```bash
48+
make test-e2e
49+
```

0 commit comments

Comments
 (0)