Skip to content

Commit

Permalink
Merge pull request #1771 from alixander/fix-e2ecli-watch
Browse files Browse the repository at this point in the history
run e2ecli watch tests serially
  • Loading branch information
alixander authored Dec 10, 2023
2 parents 957879d + 7a0003c commit 56a549d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions e2etests-cli/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func TestCLI_E2E(t *testing.T) {

tca := []struct {
name string
serial bool
skipCI bool
skip bool
run func(t *testing.T, ctx context.Context, dir string, env *xos.Env)
Expand Down Expand Up @@ -661,7 +662,8 @@ i used to read
},
},
{
name: "watch-regular",
name: "watch-regular",
serial: true,
run: func(t *testing.T, ctx context.Context, dir string, env *xos.Env) {
writeFile(t, dir, "index.d2", `
a -> b
Expand Down Expand Up @@ -711,7 +713,8 @@ layers: {
},
},
{
name: "watch-ok-link",
name: "watch-ok-link",
serial: true,
run: func(t *testing.T, ctx context.Context, dir string, env *xos.Env) {
// This link technically works because D2 interprets it as a URL,
// and on local filesystem, that is whe path where the compilation happens
Expand Down Expand Up @@ -765,7 +768,8 @@ layers: {
},
},
{
name: "watch-bad-link",
name: "watch-bad-link",
serial: true,
run: func(t *testing.T, ctx context.Context, dir string, env *xos.Env) {
// Just verify we don't crash even with a bad link (it's treated as a URL, which users might have locally)
writeFile(t, dir, "index.d2", `
Expand Down Expand Up @@ -816,7 +820,8 @@ layers: {
},
},
{
name: "watch-imported-file",
name: "watch-imported-file",
serial: true,
run: func(t *testing.T, ctx context.Context, dir string, env *xos.Env) {
writeFile(t, dir, "a.d2", `
...@b
Expand Down Expand Up @@ -895,7 +900,9 @@ c
for _, tc := range tca {
tc := tc
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
if !tc.serial {
t.Parallel()
}

if tc.skipCI && os.Getenv("CI") != "" {
t.SkipNow()
Expand Down
Binary file modified e2etests-cli/testdata/TestCLI_E2E/internal_linked_pdf.exp.pdf
Binary file not shown.

0 comments on commit 56a549d

Please sign in to comment.