Skip to content

Commit f6a90c6

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

3 files changed

Lines changed: 80 additions & 0 deletions

File tree

.openapi-generator-ignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md

.openapi-generator/FILES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.github/workflows/python.yml
22
.gitignore
33
.gitlab-ci.yml
4+
.openapi-generator-ignore
45
.travis.yml
56
README.md
67
clientapi_pbs/__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 Backup Server 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 Backup Server 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+
PBS_HOST=https://pbs.example.com:8007
54+
PBS_TOKEN='PBSAPIToken=root@pam!auto:<your-uuid>'
55+
PBS_INSECURE_TLS=1 # only when targeting a self-signed dev server
56+
```

0 commit comments

Comments
 (0)