forked from terrastruct/d2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
d2cli: Move main code into d2cli so it can be imported from tests
Updates terrastruct#903
- Loading branch information
Showing
8 changed files
with
595 additions
and
558 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package main_test | ||
|
||
func TestCLI_E2E(t *testing.T) { | ||
t.Parallel() | ||
|
||
tca := []struct{ | ||
name string | ||
run func(t testing.TB, ctx context.Context) | ||
}{ | ||
{ | ||
name: "hello_world", | ||
run: func(t *testing.T, ctx context.Context) { | ||
runCLI() | ||
}, | ||
}, | ||
} | ||
|
||
ctx := context.Background() | ||
for _, tc := range tca { | ||
tc := tc | ||
t.Run(tc.name, func(t *testing.T) { | ||
t.Parallel() | ||
|
||
ctx, cancel := context.WithTimeout(ctx, time.Minute*5) | ||
defer cancel() | ||
|
||
tc.run(t, ctx) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package main | ||
package d2cli | ||
|
||
import ( | ||
"bytes" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package main | ||
package d2cli | ||
|
||
import ( | ||
"context" | ||
|
Oops, something went wrong.