Skip to content

Commit 1c3caf3

Browse files
committed
chore: remove commented test workflow and fix resource_builder_test
- Delete unused commented-out GitHub Actions test workflow file - Add dependency check for Node.js, esbuild, and @swc/core in resource_builder_test - Skip test when required Node.js dependencies are not installed - Update RELEASE.md to document test fix
1 parent a4a76bc commit 1c3caf3

3 files changed

Lines changed: 23 additions & 53 deletions

File tree

.github/workflows/test.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

RELEASE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
### Fixes
1313
- Removed duplicated validation and prompt logic across create flows
1414
- Eliminated inconsistent success messages between feature, resource, and standalone creation
15+
- Test `resource_builder_test` fixed, to add dependencies
1516

1617
### Notes
1718
- No breaking changes

internal/builder/resource_builder_test.go

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,27 @@ package builder
22

33
import (
44
"os"
5+
"os/exec"
56
"path/filepath"
67
"runtime"
78
"testing"
89
)
910

11+
func hasRequiredNodeDeps(t *testing.T, repoRoot string) bool {
12+
t.Helper()
13+
14+
if _, err := exec.LookPath("node"); err != nil {
15+
return false
16+
}
17+
18+
cmd := exec.Command("node", "-e", "require('esbuild'); require('@swc/core');")
19+
cmd.Dir = repoRoot
20+
if err := cmd.Run(); err != nil {
21+
return false
22+
}
23+
return true
24+
}
25+
1026
func getRepoRoot(t *testing.T) string {
1127
t.Helper()
1228

@@ -259,7 +275,12 @@ func TestCopyResource(t *testing.T) {
259275
t.Fatal(err)
260276
}
261277

262-
rb := NewResourceBuilder(getRepoRoot(t))
278+
repoRoot := getRepoRoot(t)
279+
if !hasRequiredNodeDeps(t, repoRoot) {
280+
t.Skip("skipping: required Node.js dependencies not installed (esbuild, @swc/core)")
281+
}
282+
283+
rb := NewResourceBuilder(repoRoot)
263284
task := BuildTask{
264285
Path: srcDir,
265286
OutDir: outDir,

0 commit comments

Comments
 (0)