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
64 changes: 64 additions & 0 deletions .github/workflows/regression-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: 🦄 Regression Tests

on:
workflow_dispatch:
inputs:
version:
type: string
description: Terrabuild version
default: latest
prerelease:
type: boolean
description: use Terrabuild prerelease
default: false

jobs:

regression-test:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Cloning repository
uses: actions/checkout@v4

- name: Install Terrabuild
uses: magnusopera/action-install-gh-release@feature/prerelease
with:
repo: magnusopera/terrabuild
tag: ${{ inputs.version }}
prerelease: ${{ inputs.prerelease }}

- name: Info
run: |
echo 'Regression tests for ${{ github.ref }}'
terrabuild version

- name: Self Integration Tests
run: make self-test-all terrabuild=terrabuild

- name: Include Build Logs
if: always()
run: |
ls -alR > terrabuild-debug.files.txt

echo "# Self Tests" >> $GITHUB_STEP_SUMMARY
echo "## simple" >> $GITHUB_STEP_SUMMARY
cat tests/simple/terrabuild-debug.md >> $GITHUB_STEP_SUMMARY

echo "## multirefs" >> $GITHUB_STEP_SUMMARY
cat tests/multirefs/terrabuild-debug.md >> $GITHUB_STEP_SUMMARY

echo "## cluster-layers" >> $GITHUB_STEP_SUMMARY
cat tests/cluster-layers/terrabuild-debug.md >> $GITHUB_STEP_SUMMARY

- name: Upload Terrabuild Debug
if: always()
uses: actions/upload-artifact@v4
with:
name: Terrabuild Debug
path: |
**/terrabuild-debug.*
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
config ?= default
env ?= default
terrabuild = $(current_dir)/.out/dotnet/terrabuild

version ?= 0.0.0

Expand All @@ -12,6 +13,10 @@ endif
current_dir = $(shell pwd)






#
# _______ ___________ ____
# | \ | ____\ \ / /
Expand Down Expand Up @@ -74,7 +79,7 @@ docs:
dotnet run --project tools/DocGen -- src/Terrabuild.Extensions/bin/$(buildconfig)/net9.0/Terrabuild.Extensions.xml ../../websites/terrabuild.io/content/docs/extensions

self: clean publish
.out/dotnet/terrabuild run build test dist --configuration $(env) --retry --debug --logs --local-only
$(terrabuild) run build test dist --configuration $(env) --retry --debug --logs --local-only

terrabuild:
terrabuild run build test dist --configuration $(env) --retry --debug --logs --local-only
Expand Down Expand Up @@ -145,8 +150,9 @@ endef

define run_integration_test
@printf "\n*** Running integration test %s ***\n" $(1)
@$(terrabuild) version
-cd $(1); rm terrabuild-debug.*
cd $(1); GITHUB_SHA=1234 GITHUB_REF_NAME=main GITHUB_STEP_SUMMARY=terrabuild-debug.md GITHUB_REPOSITORY=magnusopera/terrabuild GITHUB_RUN_ID=42 $(current_dir)/.out/dotnet/terrabuild $(2)
cd $(1); GITHUB_SHA=1234 GITHUB_REF_NAME=main GITHUB_STEP_SUMMARY=terrabuild-debug.md GITHUB_REPOSITORY=magnusopera/terrabuild GITHUB_RUN_ID=42 $(terrabuild) $(2)
$(call diff_results,$(1))
endef

Expand All @@ -161,4 +167,4 @@ self-test-multirefs:
self-test-simple:
$(call run_integration_test, tests/simple, run build --force --debug -p 2 --logs --container-tool docker)

self-test-all: publish self-test-cluster-layers self-test-multirefs self-test-simple
self-test-all: self-test-cluster-layers self-test-multirefs self-test-simple
5 changes: 5 additions & 0 deletions tests/simple/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,8 @@ extension @terraform {
extension @cargo {
container = "rust:1.81.0-slim"
}

extension npmext {
container = "node:20"
script = "/scripts/npm.fsx"
}
10 changes: 2 additions & 8 deletions tests/simple/libraries/npm-lib/PROJECT
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@

extension @npm {
container = "node:20"
# script = "../../scripts/npm.fsx"
}


project @npm {
project npmext {
labels = [ "app" ]
}

target build {
@npm build { }
npmext build { }
}
10 changes: 2 additions & 8 deletions tests/simple/projects/npm-app/PROJECT
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@

extension @npm {
container = "node:20"
# script = "../../scripts/npm.fsx"
}


project @npm {
project npmext {
labels = [ "app" ]
}

target build {
@npm build { }
npmext build { }
}
38 changes: 19 additions & 19 deletions tests/simple/results/terrabuild-debug.build-graph.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"*.planfile"
],
"projectHash": "9FA318E272735D841D292D7D78A58E7AF5BDFAF96DDD745761807419308C8BC5",
"targetHash": "CAB8238674448CA93042A09B3DE76E889B8BA13023DBD9111FE7E8FBB488115B",
"targetHash": "5FECAE3D3D34E9893748175B100279E8FDED03C090FA30A352C9A5C1CFBFBA6C",
"operations": [
{
"container": null,
Expand Down Expand Up @@ -150,7 +150,7 @@
"project": "libraries/npm-lib",
"target": "build",
"configurationTarget": {
"hash": "3E35FE4CDBC58941D9C1FD7D9ACAC561D8397441268E863F8BFDD72EC9AE1E1A",
"hash": "6FF9DA1627A7C747024ACB388F9EDE0C888DB6279C1741C21CE10925AC7B8271",
"rebuild": false,
"dependsOn": [
"^build"
Expand All @@ -160,10 +160,10 @@
],
"operations": [
{
"hash": "8020766CA6489DE8B88803B5BE7CBC336B9BB27FEE455F2AA4A96306A85EB557",
"container": null,
"hash": "D9D320BB6A8CAFCC2A18FEC98A30C89D0D1526D887C5A7626CBF0E8E066A4AE0",
"container": "node:20",
"containerVariables": [],
"extension": "@npm",
"extension": "npmext",
"command": "build",
"script": {},
"context": [
Expand All @@ -178,19 +178,19 @@
"dist/"
],
"projectHash": "813635EFA9D98FB042EF8A761A4433B34B95BA40E1D1231B79CBDC4D29E21AF6",
"targetHash": "C31CA645B9EA52F50397213F7C65C115C26B08B5A924760E5EE1813AF2133B3B",
"targetHash": "DFB9E748B9E41C783059F0629CBE81D0348FBA319600D20BA0496D318CC9A031",
"operations": [
{
"container": null,
"container": "node:20",
"containerVariables": [],
"metaCommand": "@npm build",
"metaCommand": "npmext build",
"command": "npm",
"arguments": "ci"
},
{
"container": null,
"container": "node:20",
"containerVariables": [],
"metaCommand": "@npm build",
"metaCommand": "npmext build",
"command": "npm",
"arguments": "run build -- "
}
Expand Down Expand Up @@ -399,7 +399,7 @@
"project": "projects/npm-app",
"target": "build",
"configurationTarget": {
"hash": "3E35FE4CDBC58941D9C1FD7D9ACAC561D8397441268E863F8BFDD72EC9AE1E1A",
"hash": "6FF9DA1627A7C747024ACB388F9EDE0C888DB6279C1741C21CE10925AC7B8271",
"rebuild": false,
"dependsOn": [
"^build"
Expand All @@ -409,10 +409,10 @@
],
"operations": [
{
"hash": "8020766CA6489DE8B88803B5BE7CBC336B9BB27FEE455F2AA4A96306A85EB557",
"container": null,
"hash": "D9D320BB6A8CAFCC2A18FEC98A30C89D0D1526D887C5A7626CBF0E8E066A4AE0",
"container": "node:20",
"containerVariables": [],
"extension": "@npm",
"extension": "npmext",
"command": "build",
"script": {},
"context": [
Expand All @@ -429,19 +429,19 @@
"dist/"
],
"projectHash": "84DFD1B132F2D433231EF2345DB2CF32D7D3867BB5C1795B3DCFE0F0304A7353",
"targetHash": "50DE791CFFFCD69DA1BFBA9A902EAC469C094EABD0C1FD299BA58978C79FC0B7",
"targetHash": "504FCB25A46AC48E00ACBCE1E7B526B375192991C331D7F898AF6AEDBB678141",
"operations": [
{
"container": null,
"container": "node:20",
"containerVariables": [],
"metaCommand": "@npm build",
"metaCommand": "npmext build",
"command": "npm",
"arguments": "ci"
},
{
"container": null,
"container": "node:20",
"containerVariables": [],
"metaCommand": "@npm build",
"metaCommand": "npmext build",
"command": "npm",
"arguments": "run build -- "
}
Expand Down
16 changes: 8 additions & 8 deletions tests/simple/results/terrabuild-debug.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
],
"targets": {
"build": {
"hash": "3E35FE4CDBC58941D9C1FD7D9ACAC561D8397441268E863F8BFDD72EC9AE1E1A",
"hash": "6FF9DA1627A7C747024ACB388F9EDE0C888DB6279C1741C21CE10925AC7B8271",
"rebuild": false,
"dependsOn": [
"^build"
Expand All @@ -218,10 +218,10 @@
],
"operations": [
{
"hash": "8020766CA6489DE8B88803B5BE7CBC336B9BB27FEE455F2AA4A96306A85EB557",
"container": null,
"hash": "D9D320BB6A8CAFCC2A18FEC98A30C89D0D1526D887C5A7626CBF0E8E066A4AE0",
"container": "node:20",
"containerVariables": [],
"extension": "@npm",
"extension": "npmext",
"command": "build",
"script": {},
"context": [
Expand Down Expand Up @@ -489,7 +489,7 @@
],
"targets": {
"build": {
"hash": "3E35FE4CDBC58941D9C1FD7D9ACAC561D8397441268E863F8BFDD72EC9AE1E1A",
"hash": "6FF9DA1627A7C747024ACB388F9EDE0C888DB6279C1741C21CE10925AC7B8271",
"rebuild": false,
"dependsOn": [
"^build"
Expand All @@ -499,10 +499,10 @@
],
"operations": [
{
"hash": "8020766CA6489DE8B88803B5BE7CBC336B9BB27FEE455F2AA4A96306A85EB557",
"container": null,
"hash": "D9D320BB6A8CAFCC2A18FEC98A30C89D0D1526D887C5A7626CBF0E8E066A4AE0",
"container": "node:20",
"containerVariables": [],
"extension": "@npm",
"extension": "npmext",
"command": "build",
"script": {},
"context": [
Expand Down
Loading
Loading