forked from hermeticbuild/rules_itest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBUILD.bazel
More file actions
74 lines (64 loc) · 1.79 KB
/
Copy pathBUILD.bazel
File metadata and controls
74 lines (64 loc) · 1.79 KB
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
load("@rules_itest//:itest.bzl", "itest_service", "service_test")
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
load("//:must_fail.bzl", "must_fail")
load(":cleanup_failure_test.bzl", "cleanup_failure_test")
package(default_visibility = ["//visibility:public"])
NOT_WINDOWS = select({
"@platforms//os:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
})
sh_binary(
name = "crash_immediately",
srcs = ["crash_immediately.sh"],
)
sh_binary(
name = "cleanup_on_sigterm",
srcs = ["cleanup_on_sigterm.sh"],
)
cleanup_failure_test(
name = "cleanup_on_startup_failure_test",
target_compatible_with = NOT_WINDOWS,
test = ":dependent_startup_failure_test",
timeout = "short",
)
itest_service(
name = "immediate_exit_service",
autoassign_port = True,
env = {
"PORT": "$${PORT}",
},
exe = ":crash_immediately",
health_check_interval = "100ms",
http_health_check_address = "http://127.0.0.1:$${PORT}/health",
tags = ["manual"],
)
must_fail(
name = "service_exits_before_healthy_failure",
test = "immediate_exit_service_hygiene_test",
timeout = "short",
)
itest_service(
name = "cleanup_service",
exe = ":cleanup_on_sigterm",
shutdown_timeout = "5s",
tags = ["manual"],
)
itest_service(
name = "dependent_immediate_exit_service",
autoassign_port = True,
deps = [":cleanup_service"],
env = {
"PORT": "$${PORT}",
},
exe = ":crash_immediately",
health_check_interval = "100ms",
http_health_check_address = "http://127.0.0.1:$${PORT}/health",
tags = ["manual"],
)
service_test(
name = "dependent_startup_failure_test",
services = [":dependent_immediate_exit_service"],
tags = ["manual"],
test = "@rules_itest//:exit0",
timeout = "short",
)