Skip to content

Commit 82c6358

Browse files
committed
chore: sync from pve-openapi@f0a6069
feat(sdk-sync): reserve user-test directory + preserve non-managed workflows
1 parent 34a8275 commit 82c6358

3 files changed

Lines changed: 56 additions & 24 deletions

File tree

.openapi-generator-ignore

Lines changed: 0 additions & 23 deletions
This file was deleted.

.openapi-generator/FILES

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.github/workflows/python.yml
22
.gitignore
33
.gitlab-ci.yml
4-
.openapi-generator-ignore
54
.travis.yml
65
README.md
76
clientapi_pdm/__init__.py

tests/e2e/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# User-written E2E tests
2+
3+
This directory is reserved for **your** E2E tests against a live
4+
Proxmox Datacenter Manager server. Anything you put here:
5+
6+
* **Survives regeneration.** The generator's orphan-removal step is
7+
driven by `.openapi-generator/FILES` — files outside that manifest
8+
(including this whole directory) are never touched by `sdk-sync`.
9+
* **Survives the workflow wipe.** `sdk-bootstrap` only touches the
10+
workflow files it manages (`ci.yml`, `publish.yml`). User-added
11+
workflows like `.github/workflows/e2e.yml` are preserved verbatim.
12+
13+
The auto-generated SDK code lives outside this directory; treat
14+
everything under `tests/e2e` as your own.
15+
16+
## Quickstart
17+
18+
1. Add fixtures, helpers, and tests under `tests/e2e/`.
19+
2. (Optional) Add `.github/workflows/e2e.yml` to run them in CI against
20+
a Proxmox Datacenter Manager test instance — the sync pipeline preserves
21+
any workflow file whose name isn't in the managed allowlist.
22+
3. The generated `ci.yml` runs the SDK's own build + unit tests; wire
23+
your E2E suite into a separate workflow so it can use its own
24+
secrets / runners / schedule.
25+
26+
## Conventions per language
27+
28+
| Language | User-test path | Runner |
29+
|---|---|---|
30+
| TypeScript | `tests/e2e/*.test.ts` | `vitest run tests/e2e` |
31+
| Python | `tests/e2e/test_*.py` | `pytest tests/e2e` |
32+
| Go | `tests/e2e/*_test.go` (package `e2e_test`) | `go test ./tests/e2e/...` |
33+
| Rust | `tests/e2e/*.rs` | `cargo test --test '*'` |
34+
| PHP | `tests/E2E/*Test.php` | `vendor/bin/phpunit tests/E2E` |
35+
| Kotlin | `src/test/kotlin/e2e/*Test.kt` | `./gradlew test --tests 'e2e.*'` |
36+
37+
> The Kotlin generator's post-process step deletes
38+
> `src/test/kotlin/**/apis/*.kt` and `src/test/kotlin/**/models/*.kt`
39+
> (openapi-generator's stub tests). Keep your tests **outside** those
40+
> two subpaths — the `e2e/` directory recommended above is the
41+
> intended location and is never touched by the pipeline.
42+
43+
## Authenticating against a real server
44+
45+
Use the API-token format documented in the SDK's main README:
46+
47+
* Perl family (PVE, PMG): `<PREFIX>APIToken=USER@REALM!TOKENID=UUID`
48+
* Rust family (PBS, PDM): `<PREFIX>APIToken=USER@REALM!TOKENID:UUID`
49+
50+
Set the secret via env var so tests stay portable:
51+
52+
```sh
53+
PDM_HOST=https://pdm.example.com:8443
54+
PDM_TOKEN='PDMAPIToken=root@pam!auto:<your-uuid>'
55+
PDM_INSECURE_TLS=1 # only when targeting a self-signed dev server
56+
```

0 commit comments

Comments
 (0)