fix: configure conformance tests

This commit is contained in:
2026-01-31 17:13:02 +01:00
parent 7cbcc3f04c
commit 4784f4c4d5
8 changed files with 47 additions and 94 deletions

View File

@@ -1,50 +1,35 @@
/*
* Conformance Test: Replace Resource
* Conformance Test: Create 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.
* 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"
local testRunID = read("env:FORMAE_TEST_RUN_ID")
local stackName = "conformance-test-\(testRunID)"
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
label = "target"
config = new proxmox.Config {
url: "https://proxmox.mid:8006"
node: proxmox
}
}
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" }
}
new proxmox.LXC {
label = "test-lxc"
vmid = "220"
hostname = "test-lxc"
description = "some other description"
ostemplate = "local:vztmpl/alpine-3.22-default_20250617_amd64.tar.xz"
}
}