almost empty

This commit is contained in:
2026-01-30 22:44:32 +01:00
commit b5320bf29a
22 changed files with 1576 additions and 0 deletions

12
testdata/PklProject vendored Normal file
View File

@@ -0,0 +1,12 @@
amends "pkl:Project"
dependencies {
// Reference local plugin schema during development
// IMPORTANT: The alias must match the package name from the schema's PklProject
["proxmox"] = import("../schema/pkl/PklProject")
// Formae schema - fetched from public registry
["formae"] {
uri = "package://hub.platform.engineering/plugins/pkl/schema/pkl/formae/formae@0.80.0"
}
}

50
testdata/resource-replace.pkl vendored Normal file
View File

@@ -0,0 +1,50 @@
/*
* Conformance Test: Replace Resource
*
* This file modifies a createOnly field to trigger resource replacement.
* Changes from resource.pkl:
* - region: changed from "us-east-1" to "us-west-2"
*
* The region field has createOnly=true, so formae should delete the
* existing resource and create a new one with the new region.
*/
amends "@formae/forma.pkl"
import "@formae/formae.pkl"
import "@proxmox/proxmox.pkl"
local stackName = "plugin-sdk-test-stack"
local testRunID = read("env:FORMAE_TEST_RUN_ID")
forma {
new formae.Stack {
label = stackName
description = "Plugin SDK conformance test stack"
}
new formae.Target {
label = "example-target"
namespace = "PROXMOX"
config = new Mapping {
["region"] = "us-west-2" // CHANGED to match resource
}
}
new example.ExampleResource {
label = "plugin-sdk-test-resource"
name = "formae-plugin-sdk-test-\(testRunID)"
description = "Test resource for plugin SDK conformance tests"
region = "us-west-2" // CHANGED - triggers replacement
endpoint = new example.Endpoint {
url = "https://api.example.com"
port = 8080
protocol = "https"
}
tags = new Listing {
new example.Tag { key = "Environment"; value = "test" }
new example.Tag { key = "ManagedBy"; value = "formae" }
}
}
}

54
testdata/resource-update.pkl vendored Normal file
View File

@@ -0,0 +1,54 @@
/*
* Conformance Test: Update Resource (in-place)
*
* This file modifies mutable fields to trigger an in-place update.
* Changes from resource.pkl:
* - name: added "-updated" suffix
* - description: changed text
* - endpoint.port: changed from 8080 to 9090
* - tags: added a new tag
*
* These fields do NOT have createOnly=true, so formae should update
* the resource in place without replacement.
*/
amends "@formae/forma.pkl"
import "@formae/formae.pkl"
import "@proxmox/proxmox.pkl"
local stackName = "plugin-sdk-test-stack"
local testRunID = read("env:FORMAE_TEST_RUN_ID")
forma {
new formae.Stack {
label = stackName
description = "Plugin SDK conformance test stack"
}
new formae.Target {
label = "example-target"
namespace = "PROXMOX"
config = new Mapping {
["region"] = "us-east-1"
}
}
new example.ExampleResource {
label = "plugin-sdk-test-resource"
name = "formae-plugin-sdk-test-\(testRunID)-updated" // CHANGED
description = "Test resource - UPDATED" // CHANGED
region = "us-east-1" // unchanged (createOnly)
endpoint = new example.Endpoint {
url = "https://api.example.com"
port = 9090 // CHANGED from 8080
protocol = "https"
}
tags = new Listing {
new example.Tag { key = "Environment"; value = "test" }
new example.Tag { key = "ManagedBy"; value = "formae" }
new example.Tag { key = "UpdatedAt"; value = "conformance-test" } // ADDED
}
}
}

49
testdata/resource.pkl vendored Normal file
View File

@@ -0,0 +1,49 @@
/*
* Conformance Test: Create Resource
*
* This file defines the initial resource state for conformance testing.
* The conformance test harness will apply this file first.
*/
amends "@formae/forma.pkl"
import "@formae/formae.pkl"
import "@proxmox/proxmox.pkl"
local stackName = "plugin-sdk-test-stack"
// Read the test run ID from environment variable set by the test harness
// This ensures consistent naming within a test run but unique names between runs
local testRunID = read("env:FORMAE_TEST_RUN_ID")
forma {
new formae.Stack {
label = stackName
description = "Plugin SDK conformance test stack"
}
new formae.Target {
label = "example-target"
namespace = "PROXMOX"
// TODO: Add your provider-specific configuration
config = new Mapping {
["region"] = "us-east-1"
}
}
new example.ExampleResource {
label = "plugin-sdk-test-resource"
name = "formae-plugin-sdk-test-\(testRunID)"
description = "Test resource for plugin SDK conformance tests"
region = "us-east-1"
endpoint = new example.Endpoint {
url = "https://api.example.com"
port = 8080
protocol = "https"
}
tags = new Listing {
new example.Tag { key = "Environment"; value = "test" }
new example.Tag { key = "ManagedBy"; value = "formae" }
}
}
}