@@ -4,7 +4,114 @@ load _helper
4
4
5
5
export BATS_FIXTURE_EXPORT_CODEBASE_ENABLED=1
6
6
7
- # bats file_tags=p1
7
+ @test " ahoy build" {
8
+ run ahoy build
9
+ assert_success
10
+ assert_output_contains " PROVISION COMPLETE"
11
+ }
12
+
13
+ @test " ahoy assemble" {
14
+ run ahoy assemble
15
+ assert_success
16
+
17
+ assert_output_contains " ASSEMBLE COMPLETE"
18
+ assert_dir_exists " ${BUILD_DIR} /build/vendor"
19
+ assert_file_exists " ${BUILD_DIR} /build/composer.json"
20
+ assert_file_exists " ${BUILD_DIR} /build/composer.lock"
21
+ assert_dir_exists " ${BUILD_DIR} /node_modules"
22
+ assert_output_contains " Would run build"
23
+ }
24
+
25
+ @test " ahoy assemble - skip NPM build" {
26
+ touch " .skip_npm_build"
27
+
28
+ run ahoy assemble
29
+ assert_success
30
+
31
+ assert_output_contains " ASSEMBLE COMPLETE"
32
+ assert_dir_exists " ${BUILD_DIR} /build/vendor"
33
+ assert_file_exists " ${BUILD_DIR} /build/composer.json"
34
+ assert_file_exists " ${BUILD_DIR} /build/composer.lock"
35
+ assert_dir_exists " ${BUILD_DIR} /node_modules"
36
+ assert_output_not_contains " Would run build"
37
+ }
38
+
39
+ @test " ahoy start" {
40
+ run ahoy start
41
+ assert_failure
42
+ assert_output_not_contains " ENVIRONMENT READY"
43
+
44
+ ahoy assemble
45
+ run ahoy start
46
+ assert_success
47
+
48
+ assert_output_contains " ENVIRONMENT READY"
49
+ }
50
+
51
+ @test " ahoy stop" {
52
+ run ahoy stop
53
+ assert_success
54
+ assert_output_contains " ENVIRONMENT STOPPED"
55
+
56
+ ahoy assemble
57
+ ahoy start
58
+
59
+ run ahoy stop
60
+ assert_success
61
+ assert_output_contains " ENVIRONMENT STOPPED"
62
+ }
63
+
64
+ @test " ahoy build - basic workflow" {
65
+ run ahoy build
66
+ assert_success
67
+ assert_output_contains " PROVISION COMPLETE"
68
+
69
+ run ahoy drush status
70
+ assert_success
71
+ assert_output_contains " Database : Connected"
72
+ assert_output_contains " Drupal bootstrap : Successful"
73
+
74
+ run ahoy login
75
+ assert_success
76
+ assert_output_contains " user/reset/1/"
77
+
78
+ ahoy lint
79
+ assert_success
80
+
81
+ ahoy test
82
+ assert_success
83
+ assert_dir_exists " ${BUILD_DIR} /build/web/sites/simpletest/browser_output"
84
+ }
85
+
86
+ @test " ahoy lint, lint-fix" {
87
+ ahoy assemble
88
+ assert_success
89
+
90
+ ahoy lint
91
+ assert_success
92
+
93
+ # shellcheck disable=SC2016
94
+ echo ' $a=123;echo $a;' >> your_extension.module
95
+ run ahoy lint
96
+ assert_failure
97
+
98
+ run ahoy lint-fix
99
+ run ahoy lint
100
+ assert_success
101
+ }
102
+
103
+ @test " ahoy test unit failure" {
104
+ run ahoy assemble
105
+ assert_success
106
+
107
+ run ahoy test-unit
108
+ assert_success
109
+
110
+ sed -i -e " s/assertEquals/assertNotEquals/g" " ${BUILD_DIR} /tests/src/Unit/YourExtensionServiceUnitTest.php"
111
+ run ahoy test-unit
112
+ assert_failure
113
+ }
114
+
8
115
@test " ahoy test functional failure" {
9
116
run ahoy build
10
117
assert_success
@@ -14,7 +121,20 @@ export BATS_FIXTURE_EXPORT_CODEBASE_ENABLED=1
14
121
assert_dir_exists " ${BUILD_DIR} /build/web/sites/simpletest/browser_output"
15
122
rm -Rf " ${BUILD_DIR} /build/web/sites/simpletest/browser_output" || true
16
123
124
+ rm -Rf " ${BUILD_DIR} /build/web/sites/simpletest/browser_output" || true
17
125
sed -i -e " s/responseContains/responseNotContains/g" " ${BUILD_DIR} /tests/src/Functional/YourExtensionFunctionalTest.php"
18
126
run ahoy test-functional
19
127
assert_failure
20
128
}
129
+
130
+ @test " ahoy test kernel failure" {
131
+ run ahoy build
132
+ assert_success
133
+
134
+ run ahoy test-kernel
135
+ assert_success
136
+
137
+ sed -i -e " s/assertEquals/assertNotEquals/g" " ${BUILD_DIR} /tests/src/Kernel/YourExtensionServiceKernelTest.php"
138
+ run ahoy test-kernel
139
+ assert_failure
140
+ }
0 commit comments