Skip to content

Commit c938b2b

Browse files
committed
Stricter ethd CI
1 parent a79c867 commit c938b2b

2 files changed

Lines changed: 91 additions & 76 deletions

File tree

.github/test-ethd-config.exp

Lines changed: 88 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -20,111 +20,124 @@ proc address {} {
2020
send "0xDccf8451070a86183eE70D330C4c43b686E9CF86\t\r"
2121
}
2222

23-
proc default-deployment {} {
24-
global spawn_id
25-
expect "Select Network"
26-
accept_default
23+
proc expect_or_fail {pattern procname {t ""}} {
24+
set old_timeout $::timeout
25+
if {$t ne ""} {
26+
set ::timeout $t
27+
}
28+
expect {
29+
$pattern {
30+
$procname
31+
}
32+
timeout {
33+
puts "Timeout waiting for: $pattern"
34+
exit 1
35+
}
36+
eof {
37+
puts "Unexpected EOF while waiting for: $pattern"
38+
exit 1
39+
}
40+
}
41+
set ::timeout $old_timeout
42+
}
2743

28-
expect "Select deployment type"
29-
accept_default
44+
proc expect_optional {pattern procname {t ""}} {
45+
set old_timeout $::timeout
46+
if {$t ne ""} {
47+
set ::timeout $t
48+
}
49+
expect {
50+
$pattern {
51+
$procname
52+
}
53+
timeout {}
54+
eof {
55+
puts "Unexpected EOF while waiting for optional: $pattern"
56+
exit 1
57+
}
58+
}
59+
set ::timeout $old_timeout
60+
}
3061

31-
expect "Select consensus client"
32-
accept_default
62+
proc expect_eof {{t ""}} {
63+
set old_timeout $::timeout
64+
if {$t ne ""} {
65+
set ::timeout $t
66+
}
67+
expect {
68+
eof {}
69+
timeout {
70+
if {$t ne ""} {
71+
puts "Timeout waiting for EOF"
72+
exit 1
73+
}
74+
}
75+
}
76+
set ::timeout $old_timeout
77+
}
3378

34-
expect "Select execution client"
35-
accept_default
79+
proc default-deployment {} {
80+
expect_or_fail "Select Network" accept_default
81+
expect_or_fail "Select deployment type" accept_default
82+
expect_or_fail "Select consensus client" accept_default
83+
expect_optional "Web3signer" yes 5
84+
expect_or_fail "Select execution client" accept_default
3685
}
3786

87+
# Called without .env
3888
proc all-defaults {} {
39-
global spawn_id
4089
default-deployment
4190

42-
expect "Configure CL checkpoint sync URL"
43-
accept_default
44-
45-
expect "MEV Boost"
46-
yes
47-
48-
expect "Relays list"
49-
accept_default
50-
51-
expect "Grafana"
52-
yes
91+
expect_or_fail "Configure CL checkpoint sync URL" accept_default
92+
expect_or_fail "MEV Boost" yes
93+
expect_or_fail "Relays list" accept_default
94+
expect_optional "MEV Build Factor" yes 120
95+
expect_or_fail "Grafana" yes
96+
expect_or_fail "Configure rewards address" address
97+
expect_or_fail "Configure Graffiti" accept_default
98+
expect_or_fail "Default Graffiti" yes
5399

54-
expect "Configure rewards address"
55-
address
56-
57-
expect "Configure Graffiti"
58-
accept_default
59-
60-
expect "Default Graffiti"
61-
yes
62-
63-
expect EOF
100+
expect_eof 15
64101
}
65102

103+
# Called after all-defaults, existing .env
66104
proc no-mev {} {
67-
global spawn_id
68105
default-deployment
69106

70-
expect "Configure CL checkpoint sync URL"
71-
accept_default
72-
73-
expect "MEV Boost"
74-
no
75-
76-
expect "Grafana"
77-
yes
78-
79-
expect "Configure rewards address"
80-
address
81-
82-
expect "Configure Graffiti"
83-
accept_default
107+
expect_or_fail "Configure CL checkpoint sync URL" accept_default
108+
expect_or_fail "MEV Boost" no
109+
expect_or_fail "Grafana" yes
110+
expect_or_fail "Configure rewards address" accept_default
111+
expect_or_fail "Configure Graffiti" accept_default
112+
expect_or_fail "Default Graffiti" yes
84113

85-
expect "Default Graffiti"
86-
yes
87-
88-
expect EOF
114+
expect_eof 15
89115
}
90116

117+
# Called after all-defaults, existing .env
91118
proc no-grafana {} {
92-
global spawn_id
93119
default-deployment
94120

95-
expect "Configure CL checkpoint sync URL"
96-
accept_default
97-
98-
expect "MEV Boost"
99-
yes
100-
101-
expect "Relays list"
102-
accept_default
103-
104-
expect "Grafana"
105-
no
106-
107-
expect "Configure rewards address"
108-
address
109-
110-
expect "Configure Graffiti"
111-
accept_default
112-
113-
expect "Default Graffiti"
114-
yes
121+
expect_or_fail "Configure CL checkpoint sync URL" accept_default
122+
expect_or_fail "MEV Boost" yes
123+
expect_or_fail "Relays list" accept_default
124+
expect_optional "MEV Build Factor" yes
125+
expect_or_fail "Grafana" no
126+
expect_or_fail "Configure rewards address" accept_default
127+
expect_or_fail "Configure Graffiti" accept_default
128+
expect_or_fail "Default Graffiti" yes
115129

116-
expect EOF
130+
expect_eof 15
117131
}
118132

119133
set timeout 5
120-
spawn ./ethd config
134+
spawn ./ethd config --ci
121135

122136
# Check for the command-line argument
123137
if {$argc > 0} {
124138
set action [lindex $argv 0]
125139
switch -- $action {
126140
"all-defaults" all-defaults
127-
"no-checkpoint" no-checkpoint
128141
"no-mev" no-mev
129142
"no-grafana" no-grafana
130143
default { puts "Unknown action: $action"; exit 1 }

ethd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5720,7 +5720,9 @@ config() {
57205720
__final_msg+="\nYou are using these service files: ${CORE_FILES}${CUSTOM_FILES:+:${CUSTOM_FILES}}"
57215721

57225722
__get_compose_file
5723-
__pull_and_build
5723+
if [[ ! "$*" =~ "--ci" ]]; then
5724+
__pull_and_build
5725+
fi
57245726
__nag_os_version
57255727

57265728
echo -e "${__final_msg-}"

0 commit comments

Comments
 (0)