Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
run: |
pnpm run build
pnpm run package
pnpm run build:edge-bindings
env:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
GOCACHE: ${{ steps.global-cache-dir-path.outputs.go }}
Expand All @@ -89,6 +90,7 @@ jobs:
with:
name: ${{ inputs.edge_bindings_artifact_name }}
path: packages/@cdktn/provider-generator/edge-provider-bindings
if-no-files-found: error
- name: installing test dependencies
run: cd test && pnpm ci
- name: Build test matrix
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
node tools/align-version.mjs
pnpm run build
pnpm run package
pnpm run build:edge-bindings
env:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
- name: Add sourcemap and commit info to sentry
Expand All @@ -92,6 +93,7 @@ jobs:
with:
name: edge-provider-bindings-release
path: packages/@cdktn/provider-generator/edge-provider-bindings
if-no-files-found: error

# ---------------------------------------------------------------------------
# Next channel: always bumps to a fresh prerelease version on each push to
Expand Down Expand Up @@ -158,6 +160,7 @@ jobs:
pnpm ci
pnpm run build
pnpm run package
pnpm run build:edge-bindings
env:
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
- name: Add sourcemap and commit info to sentry
Expand All @@ -177,6 +180,7 @@ jobs:
with:
name: edge-provider-bindings-next
path: packages/@cdktn/provider-generator/edge-provider-bindings
if-no-files-found: error
- name: publish tag
run: git push origin "v${{ steps.get_version.outputs.version }}"

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"scripts": {
"build-and-package": "nx run-many -t build package -p \"cdktn*\" \"@cdktn/*\" && node tools/collect-dist.mjs",
"build": "nx run-many -t build -p \"cdktn*\" \"@cdktn/*\"",
"build:edge-bindings": "nx run-many -t build:edge-bindings -p @cdktn/provider-generator",
"format": "prettier --cache --write .",
"package": "GOWORK=off nx run-many -t package && node tools/collect-dist.mjs",
"package:python": "nx run-many -t package:python && node tools/collect-dist.mjs",
Expand Down
23 changes: 21 additions & 2 deletions packages/@cdktn/provider-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,33 @@
"main": "build/index.js",
"types": "build/index.d.ts",
"nx": {
"tags": ["unit-test:terraform"]
"tags": ["unit-test:terraform"],
"targets": {
"build": {
"inputs": [
"production",
"^production",
"{projectRoot}/src/__tests__/edge-provider-schema/**"
]
},
"build:edge-bindings": {
"dependsOn": ["build"],
"inputs": [
"production",
"^production",
"{projectRoot}/src/__tests__/edge-provider-schema/**"
],
"outputs": ["{projectRoot}/edge-provider-bindings"],
"cache": true
}
}
},
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "tsc",
"postbuild": "node ./build/__tests__/edge-provider-schema/cli.js ./edge-provider-bindings",
"build:edge-bindings": "node ./build/__tests__/edge-provider-schema/cli.js ./edge-provider-bindings",
"watch": "tsc -w",
"watch-preserve-output": "tsc -w --preserveWatchOutput",
"test:update": "jest -u",
Expand Down
2 changes: 1 addition & 1 deletion test/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Test Environment:

To test all edge cases without building all providers we create an edge provider that contains all these edge cases.
The provider lives under `packages/@cdktn/provider-generator/lib/__tests__/edge-provider-schema` and the provider bindings are tested there through snapshots.
We generate the schema into `packages/@cdktn/provider-generator/edge-provider-bindings` on build and copy them through GH Actions or the `edge:install` command.
The root `build:edge-bindings` script generates the bindings into `packages/@cdktn/provider-generator/edge-provider-bindings`; GH Actions uploads them from there, and the `edge:install` command runs it and copies the result for a local run.

We also build a helper to translate an initial version of these tests through the different languages, `edge:translateTests` takes the typescript `main.ts` and translates it to the other languages. The translation is not perfect, but a good start.

Expand Down
2 changes: 1 addition & 1 deletion test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.0.0",
"description": "This directory contains integration tests for the cdktn project.",
"scripts": {
"edge:install": "rm -rf ./edge-provider-bindings && cp -R ../packages/@cdktn/provider-generator/edge-provider-bindings/ ./edge-provider-bindings",
"edge:install": "pnpm --dir .. run build:edge-bindings && rm -rf ./edge-provider-bindings && cp -R ../packages/@cdktn/provider-generator/edge-provider-bindings/ ./edge-provider-bindings",
"edge:translateTests": "node ./translate-edge-tests.js",
"preedge:update": "npm run edge:install",
"edge:update": "./run-against-dist.mjs ./update-edge.sh",
Expand Down
Loading