forked from whywaita/shoes-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_test.go
47 lines (37 loc) · 1.13 KB
/
main_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package main
import (
"context"
"os"
"testing"
"github.com/whywaita/myshoes-providers/shoes-aws/testutils"
pb "github.com/whywaita/myshoes/api/proto"
)
func TestMain(m *testing.M) {
os.Exit(testutils.IntegrationTestRunner(m))
}
func Test_createRunnerInstance(t *testing.T) {
ctx := context.Background()
testEndpoint := testutils.GetTestEndpoint()
a, err := newServer(ctx, testEndpoint)
if err != nil {
t.Fatalf("failed to newServer: %+v", err)
}
if _, _, err := a.createRunnerInstance(ctx, "test-runner", "echo 0", pb.ResourceType_Nano); err != nil {
t.Fatalf("failed to createRunnerInstance: %+v", err)
}
}
func Test_deleteRunnerInstance(t *testing.T) {
ctx := context.Background()
testEndpoint := testutils.GetTestEndpoint()
a, err := newServer(ctx, testEndpoint)
if err != nil {
t.Fatalf("failed to newServer: %+v", err)
}
instanceID, _, err := a.createRunnerInstance(ctx, "test-runner", "echo 0", pb.ResourceType_Nano)
if err != nil {
t.Fatalf("failed to createRunnerInstance: %+v", err)
}
if err := a.deleteRunnerInstance(ctx, instanceID); err != nil {
t.Fatalf("failed to deleteRunnerInstance: %+v", err)
}
}