Skip to content

Commit 7dbb3ed

Browse files
committed
fix: Test script fixes
1 parent 1fb3e34 commit 7dbb3ed

File tree

4 files changed

+32
-6
lines changed

4 files changed

+32
-6
lines changed

templates/.gitignore.tpl

+9-2
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,17 @@ vendor
3636
# macOS
3737
.DS_Store
3838

39-
# Ignore literally everything other than the stencil.yaml file in the tests dir
39+
# Ignore literally everything under the tests directory (except the README) -- specifically include the dir and stencil.yaml file
40+
# for each test case in the ignores block below
4041
tests/*
41-
!tests/**/stencil.yaml
42+
!tests/README.md
4243

4344
## <<Stencil::Block(ignores)>>
45+
{{- if file.Block "ignores" }}
4446
{{ file.Block "ignores" }}
47+
{{- else }}
48+
!tests/basic
49+
tests/basic/*
50+
!tests/basic/stencil.yaml
51+
{{- end }}
4552
## <</Stencil::Block>>

templates/.mise.toml.tpl

+10-4
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,28 @@ nodejs = "22"
33
yarn = "1.22.22"
44

55
[tasks.cleantest]
6-
description = "Clean the test directory"
7-
dir = "test"
8-
run = ["git clean -xdf"]
6+
description = "Helper to clean the test directory"
7+
dir = "tests"
8+
run = """
9+
#!/usr/bin/env bash
10+
for dir in ./*/ ; do
11+
(cd "$dir" && git clean -xdf);
12+
done
13+
"""
914

1015
[tasks.buildtest]
1116
description = 'Build the Test templates'
17+
dir = "tests"
1218
run = """
1319
#!/usr/bin/env bash
14-
cd tests
1520
for dir in ./*/ ; do
1621
(cd "$dir" && stencil);
1722
done
1823
"""
1924

2025
[tasks.runtest]
2126
description = 'Run the tests'
27+
dir = "tests"
2228
## <<Stencil::Block(runTests)>>
2329
{{- if (empty (file.Block "runTests")) }}
2430
env = {ENV_VAR_NAME = 'hooray'} # env vars for the script
File renamed without changes.
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- file.Once -}}
2+
# yaml-language-server: $schema=https://stencil.rgst.io/static/stencil.jsonschema.json
3+
name: {{ .Config.Name }}-test
4+
arguments:
5+
description: Test folder for validating changes to {{ .Config.Name }}
6+
owner: {{ stencil.Arg "owner"}}
7+
## <<Stencil::Block(arguments)>>
8+
{{ file.Block "arguments" }}
9+
## <</Stencil::Block>>
10+
modules:
11+
- name: github.com/udemy/{{ .Config.Name }}
12+
replacements:
13+
github.com/udemy/{{ .Config.Name }}: ../../

0 commit comments

Comments
 (0)