-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.bats
126 lines (107 loc) · 3.1 KB
/
test.bats
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/usr/bin/env bats
export SYSTEM_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')"
export LAMBDA_BUILDER_BIN="build/$SYSTEM_NAME/lambda-builder-amd64"
setup_file() {
make prebuild "$LAMBDA_BUILDER_BIN"
}
teardown_file() {
make clean
}
@test "[build] write procfile" {
skip "This test does not run correctly in Github Actions due to use of embedded docker"
run $LAMBDA_BUILDER_BIN build --working-directory tests/go --write-procfile
echo "output: $output"
echo "status: $status"
[[ "$status" -eq 0 ]]
[[ -f tests/go/Procfile ]]
}
@test "[build] dotnet6" {
run $LAMBDA_BUILDER_BIN build --working-directory tests/dotnet6
echo "output: $output"
echo "status: $status"
[[ "$status" -eq 0 ]]
}
@test "[build] go" {
run $LAMBDA_BUILDER_BIN build --working-directory tests/go
echo "output: $output"
echo "status: $status"
[[ "$status" -eq 0 ]]
}
@test "[build] go without go modules" {
run $LAMBDA_BUILDER_BIN build --working-directory tests/go-nomod
echo "output: $output"
echo "status: $status"
[[ "$status" -eq 0 ]]
}
@test "[build] hooks" {
run $LAMBDA_BUILDER_BIN build --working-directory tests/hooks
echo "output: $output"
echo "status: $status"
[[ "$status" -eq 0 ]]
}
@test "[build] lambda.yml" {
run $LAMBDA_BUILDER_BIN build --working-directory tests/lambda.yml
echo "output: $output"
echo "status: $status"
[[ "$status" -eq 0 ]]
}
@test "[build] lambda.yml-invalid-image" {
run $LAMBDA_BUILDER_BIN build --working-directory tests/lambda.yml-invalid-image
echo "output: $output"
echo "status: $status"
[[ "$status" -eq 1 ]]
}
@test "[build] lambda.yml-nonexistent-builder" {
run $LAMBDA_BUILDER_BIN build --working-directory tests/lambda.yml-nonexistent-builder
echo "output: $output"
echo "status: $status"
[[ "$status" -eq 1 ]]
}
@test "[build] npm" {
run $LAMBDA_BUILDER_BIN build --working-directory tests/npm
echo "output: $output"
echo "status: $status"
[[ "$status" -eq 0 ]]
}
@test "[build] nonexistent" {
run $LAMBDA_BUILDER_BIN build --working-directory tests/nonexistent
echo "output: $output"
echo "status: $status"
[[ "$status" -eq 1 ]]
}
@test "[build] non-detected" {
run $LAMBDA_BUILDER_BIN build --working-directory tests/non-detected
echo "output: $output"
echo "status: $status"
[[ "$status" -eq 1 ]]
}
@test "[build] pip" {
run $LAMBDA_BUILDER_BIN build --working-directory tests/pip
echo "output: $output"
echo "status: $status"
[[ "$status" -eq 0 ]]
}
@test "[build] pip-runtime" {
run $LAMBDA_BUILDER_BIN build --working-directory tests/pip-runtime
echo "output: $output"
echo "status: $status"
[[ "$status" -eq 0 ]]
}
@test "[build] pipenv" {
run $LAMBDA_BUILDER_BIN build --working-directory tests/pipenv
echo "output: $output"
echo "status: $status"
[[ "$status" -eq 0 ]]
}
@test "[build] poetry" {
run $LAMBDA_BUILDER_BIN build --working-directory tests/poetry
echo "output: $output"
echo "status: $status"
[[ "$status" -eq 0 ]]
}
@test "[build] ruby" {
run $LAMBDA_BUILDER_BIN build --working-directory tests/ruby
echo "output: $output"
echo "status: $status"
[[ "$status" -eq 0 ]]
}