Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .config/mise.lock
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ url = "https://github.com/pulumi/pulumi/releases/download/v3.190.0/pulumi-v3.190
version = "3.11.8"
backend = "core:python"

[[tools.usage]]
version = "2.5.1"
backend = "aqua:jdx/usage"

[tools.usage.platforms.macos-arm64]
checksum = "sha256:a71c1017e64786a7094909c31c0c5aa1cfb1cec2f3b3bce112e654abd2b4232e"
size = 5027353
url = "https://github.com/jdx/usage/releases/download/v2.5.1/usage-universal-apple-darwin.tar.gz"

[[tools."vfox-pulumi:pulumi/pulumi-archive"]]
version = "0.3.5"
backend = "vfox-pulumi:pulumi/pulumi-archive"
Expand Down
29 changes: 29 additions & 0 deletions .config/mise.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
# WARNING: This file is autogenerated - changes will be overwritten when regenerated by https://github.com/pulumi/ci-mgmt
# You can create your own root-level mise.toml file to override/augment this. See https://mise.jdx.dev/configuration.html

[vars]
upstream_head = "{{ exec(command='git rev-parse --git-path modules/upstream/HEAD') | trim }}"

[env]
_.source = "{{config_root}}/scripts/get-versions.sh"
PULUMI_HOME = "{{config_root}}/.pulumi"
PULUMI_CONVERT_EXAMPLES_CACHE_DIR = "{{config_root}}/.pulumi/examples-cache"
PACK = "aws"
ORG = "pulumi"
PROJECT = "github.com/pulumi/pulumi-aws"
PROVIDER_PATH = "provider/v7"
VERSION_PATH = "provider/v7/pkg/version.Version"
CODEGEN = "pulumi-tfgen-aws"
PROVIDER = "pulumi-resource-aws"
PROVIDER_VERSION = "7.0.0-alpha.0+dev"
TESTPARALLELISM = "10"
GOTESTARGS = ""
PULUMI_CONVERT = "1"
PULUMI_MISSING_DOCS_ERROR = "true"
PULUMI_PROVIDER_BUILD_PARALLELISM = "-p 2"
LDFLAGS_STRIP_SYMBOLS = "-s -w"
LDFLAGS_PROJ_VERSION = "-X {{ env.PROJECT }}/{{ env.VERSION_PATH }}={{ env.PROVIDER_VERSION }} -X github.com/hashicorp/terraform-provider-aws/version.ProviderVersion={{ env.PROVIDER_VERSION }}"
LDFLAGS_UPSTREAM_VERSION = "-X github.com/hashicorp/terraform-provider-aws/version.ProviderVersion=v{{ env.PROVIDER_VERSION }}"
LDFLAGS_EXTRAS = ""
LDFLAGS = "{{ env.LDFLAGS_PROJ_VERSION }} {{ env.LDFLAGS_UPSTREAM_VERSION }} {{ env.LDFLAGS_EXTRAS }} {{ env.LDFLAGS_STRIP_SYMBOLS }}"

[tools]

Expand Down Expand Up @@ -32,6 +54,13 @@ golangci-lint = "1.64.8" # See note about about overrides if you need to customi
"vfox-pulumi:pulumi/pulumi-random" = "latest"
"vfox-pulumi:pulumi/pulumi-std" = "latest"
"vfox-pulumi:pulumi/pulumi-converter-terraform" = "latest"
usage = "latest"

[task_config]
includes = [
".config/provider-base.toml",
".config/mise/tasks",
]

[settings]
experimental = true # Required for Go binaries (e.g. pulumictl).
Expand Down
67 changes: 67 additions & 0 deletions .config/mise/tasks/mark
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/usr/bin/env bash
set -euo pipefail
#MISE description "Run supported :mark tasks for SDK generation/build targets"
#USAGE flag "--list" help="Show supported targets and exit"
#USAGE arg "[task]" help="SDK task(s) to mark complete" var=#true

list=${usage_list:-false}
tasks=()
if [[ -n "${usage_task:-}" ]]; then
# shellcheck disable=SC2206 # splitting on IFS is safe for task identifiers
tasks=(${usage_task})
fi

readonly SUPPORTED=(
generate:sdks:dotnet
generate:sdks:go
generate:sdks:java
generate:sdks:nodejs
generate:sdks:python
build:sdks:dotnet
build:sdks:go
build:sdks:java
build:sdks:nodejs
build:sdks:python
)

if [[ "$list" == "true" ]]; then
printf '%s\n' "${SUPPORTED[@]}"
exit 0
fi

if ((${#tasks[@]} == 0)); then
printf 'mark: provide at least one task (try --help)\n' >&2
exit 1
fi

status=0
for task in "${tasks[@]}"; do
base="$task"
if [[ "$base" == *":mark" ]]; then
base="${base%:mark}"
target="$task"
else
target="${task}:mark"
fi

supported=false
for allowed in "${SUPPORTED[@]}"; do
if [[ "$base" == "$allowed" ]]; then
supported=true
break
fi
done

if [[ "$supported" == false ]]; then
printf 'mark: unsupported target "%s"\n' "$task" >&2
status=1
continue
fi

if ! mise run "$target"; then
printf 'mark: failed to run %s\n' "$target" >&2
status=1
fi
done

exit $status
45 changes: 45 additions & 0 deletions .config/mise/tasks/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env bash
set -euo pipefail

#MISE description "Run example integration tests"
#MISE dir="examples"
#MISE env={PATH="{{ [config_root, 'bin'] | join_path }}:{{ env.PATH }}"}
#USAGE flag "--pkg <pattern>" help="Package pattern to test" default="./..."
#USAGE flag "--run <regex>" help="Regex passed to go test -run"
#USAGE flag "--tags <tags>" help="Go build tags" default="all"
#USAGE flag "--timeout <duration>" help="go test timeout" default="2h"
#USAGE flag "--count <n>" help="go test -count" default="1"
#USAGE flag "--args <args>" help="Additional go test args"

pkg="${usage_pkg:-./...}"
tags="${usage_tags:-all}"
timeout="${usage_timeout:-2h}"
count="${usage_count:-1}"
run_regex="${usage_run:-}"
extra_args="${usage_args:-}"

if [[ ! -x "{{ [config_root, 'bin', 'pulumi-resource-aws'] | join_path }}" ]]; then
echo "Expected provider binary at $(realpath {{ [config_root, 'bin', 'pulumi-resource-aws'] | join_path }}), but it is missing." >&2
echo "Run 'mise run build' or restore the provider artifact before running tests." >&2
exit 1
fi

args=(go test -v -parallel "${TESTPARALLELISM:-10}" -tags "${tags}" -timeout "${timeout}" -count "${count}")

if [ -n "${GOTESTARGS:-}" ]; then
# shellcheck disable=SC2206
args+=(${GOTESTARGS})
fi

if [ -n "${extra_args}" ]; then
# shellcheck disable=SC2206
args+=(${extra_args})
fi

if [ -n "${run_regex}" ]; then
args+=(-run "${run_regex}")
fi

args+=("${pkg}")

"${args[@]}"
42 changes: 42 additions & 0 deletions .config/mise/tasks/test-provider
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash
set -euo pipefail

#MISE description "Run provider unit tests"
#MISE dir="provider"
#MISE env={PATH="{{ [config_root, 'bin'] | join_path }}:{{ env.PATH }}"}
#USAGE flag "--pkg <pattern>" help="Package pattern to test" default="./..."
#USAGE flag "--run <regex>" help="Regex passed to go test -run"
#USAGE flag "--coverpkg <pattern>" help="Override -coverpkg" default="./...,github.com/hashicorp/terraform-provider-..."
#USAGE flag "--timeout <duration>" help="go test timeout" default="15m"
#USAGE flag "--count <n>" help="go test -count" default="1"
#USAGE flag "--args <args>" help="Additional go test args"
#USAGE flag "--no-short" help="Disable -short"

pkg="${usage_pkg:-./...}"
coverpkg="${usage_coverpkg:-./...,github.com/hashicorp/terraform-provider-...}"
timeout="${usage_timeout:-15m}"
count="${usage_count:-1}"
run_regex="${usage_run:-}"
extra_args="${usage_args:-}"
no_short="${usage_no_short:-false}"

args=(go test -v)

if [ "${no_short}" != "true" ]; then
args+=(-short)
fi

args+=(-coverprofile="coverage.txt" -coverpkg "${coverpkg}" -parallel "${TESTPARALLELISM:-10}" -timeout "${timeout}" -count "${count}")

if [ -n "${extra_args}" ]; then
# shellcheck disable=SC2206
args+=(${extra_args})
fi

if [ -n "${run_regex}" ]; then
args+=(-run "${run_regex}")
fi

args+=("${pkg}")

"${args[@]}"
Loading
Loading