e2etests-cli: Skip png tests on CI

PNG renders seem to work intermittently on github actions so whatever.
If we're ignoring the diffs we might as well not even run these on CI.
This commit is contained in:
Anmol Sethi 2023-03-02 21:28:33 -08:00
parent 7077f2edef
commit ae689fcc1f
No known key found for this signature in database
GPG key ID: 25BC68888A99A8BA

View file

@ -18,11 +18,13 @@ func TestCLI_E2E(t *testing.T) {
t.Parallel() t.Parallel()
tca := []struct { tca := []struct {
name string name string
run func(t *testing.T, ctx context.Context, dir string, env *xos.Env) skipCI bool
run func(t *testing.T, ctx context.Context, dir string, env *xos.Env)
}{ }{
{ {
name: "hello_world_png", name: "hello_world_png",
skipCI: true,
run: func(t *testing.T, ctx context.Context, dir string, env *xos.Env) { run: func(t *testing.T, ctx context.Context, dir string, env *xos.Env) {
writeFile(t, dir, "hello-world.d2", `x -> y`) writeFile(t, dir, "hello-world.d2", `x -> y`)
err := runTestMain(t, ctx, dir, env, "hello-world.d2", "hello-world.png") err := runTestMain(t, ctx, dir, env, "hello-world.d2", "hello-world.png")
@ -32,7 +34,8 @@ func TestCLI_E2E(t *testing.T) {
}, },
}, },
{ {
name: "hello_world_png_pad", name: "hello_world_png_pad",
skipCI: true,
run: func(t *testing.T, ctx context.Context, dir string, env *xos.Env) { run: func(t *testing.T, ctx context.Context, dir string, env *xos.Env) {
writeFile(t, dir, "hello-world.d2", `x -> y`) writeFile(t, dir, "hello-world.d2", `x -> y`)
err := runTestMain(t, ctx, dir, env, "--pad=400", "hello-world.d2", "hello-world.png") err := runTestMain(t, ctx, dir, env, "--pad=400", "hello-world.d2", "hello-world.png")
@ -42,7 +45,8 @@ func TestCLI_E2E(t *testing.T) {
}, },
}, },
{ {
name: "hello_world_png_sketch", name: "hello_world_png_sketch",
skipCI: true,
run: func(t *testing.T, ctx context.Context, dir string, env *xos.Env) { run: func(t *testing.T, ctx context.Context, dir string, env *xos.Env) {
writeFile(t, dir, "hello-world.d2", `x -> y`) writeFile(t, dir, "hello-world.d2", `x -> y`)
err := runTestMain(t, ctx, dir, env, "--sketch", "hello-world.d2", "hello-world.png") err := runTestMain(t, ctx, dir, env, "--sketch", "hello-world.d2", "hello-world.png")
@ -126,6 +130,10 @@ scenarios: {
t.Run(tc.name, func(t *testing.T) { t.Run(tc.name, func(t *testing.T) {
t.Parallel() t.Parallel()
if tc.skipCI && os.Getenv("CI") != "" {
t.SkipNow()
}
ctx, cancel := context.WithTimeout(ctx, time.Minute*5) ctx, cancel := context.WithTimeout(ctx, time.Minute*5)
defer cancel() defer cancel()