Skip to content

Commit 070ca20

Browse files
authored
FIX: Integration and Molecule Tests (#2265)
* FIX: Integration Tests * FIX: molecule workflow * FIX: Nimbus Secrets Volume
1 parent 102a365 commit 070ca20

18 files changed

+117
-100
lines changed

.github/workflows/test-molecule.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ jobs:
6868
matrix:
6969
tests:
7070
[
71-
{ role: "update-changes", test: "222" },
72-
{ role: "update-changes", test: "223" },
73-
{ role: "update-changes", test: "224" },
71+
{ role: "update-changes", test: "232" },
72+
{ role: "update-changes", test: "235" },
73+
{ role: "update-changes", test: "241" },
7474
]
7575
fail-fast: false
7676
concurrency: molecule-test-${{ matrix.tests.role }}-${{ matrix.tests.test }}

controls/defaults/stereum_defaults.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ stereum_static:
77
lane: stable
88
unattended:
99
install: false
10+
interval_days: 1
11+
hour: 1
12+
min: 30
1013
arch: x86_64
1114
versions:
1215
# consensus clients

controls/roles/manage-service/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
owner: "{{ stereum_service_configuration.user }}"
4545
group: "{{ stereum_service_configuration.user }}"
4646
mode: 0700
47-
recurse: yes
47+
recurse: "{{ 'no' if (stereum_service_configuration.service == 'NimbusValidatorService' and item.split(':') | last == '/opt/app/secrets') else 'yes' }}"
4848
changed_when: false
4949
become: yes
5050
when:

launcher/src/backend/tests/integration/BesuService.int.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ test("besu installation", async () => {
5656
await nodeConnection.prepareStereumNode(nodeConnection.settings.stereum.settings.controls_install_path);
5757

5858
//install besu
59-
let executionClient = serviceManager.getService("BesuService", { network: "holesky", installDir: "/opt/stereum" });
59+
let executionClient = serviceManager.getService("BesuService", { network: "hoodi", installDir: "/opt/stereum" });
6060

6161
let versions = await nodeConnection.nodeUpdates.checkUpdates();
6262
executionClient.imageVersion = versions[executionClient.network][executionClient.service].slice(-1).pop();

launcher/src/backend/tests/integration/ErigonService.int.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ test("erigon installation", async () => {
5656
await nodeConnection.prepareStereumNode(nodeConnection.settings.stereum.settings.controls_install_path);
5757

5858
//install erigon
59-
let executionClient = serviceManager.getService("ErigonService", { network: "holesky", installDir: "/opt/stereum" });
59+
let executionClient = serviceManager.getService("ErigonService", { network: "hoodi", installDir: "/opt/stereum" });
6060

6161
let versions = await nodeConnection.nodeUpdates.checkUpdates();
6262
executionClient.imageVersion = versions[executionClient.network][executionClient.service].slice(-1).pop();

launcher/src/backend/tests/integration/FlashbotsMevBoostService.int.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ test("mevboost installation", async () => {
5757

5858
//install mevboost
5959
let mevboost = serviceManager.getService("FlashbotsMevBoostService", {
60-
network: "holesky",
60+
network: "hoodi",
6161
relays:
62-
"https://0xafa4c6985aa049fb79dd37010438cfebeb0f2bd42b115b89dd678dab0670c1de38da0c4e9138c9290a398ecd9a0b3110@boost-relay-holesky.flashbots.net",
62+
"https://0xafa4c6985aa049fb79dd37010438cfebeb0f2bd42b115b89dd678dab0670c1de38da0c4e9138c9290a398ecd9a0b3110@boost-relay-hoodi.flashbots.net",
6363
});
6464

6565
let versions = await nodeConnection.nodeUpdates.checkUpdates();
@@ -76,7 +76,7 @@ test("mevboost installation", async () => {
7676
await testServer.Sleep(30000);
7777
status = await nodeConnection.sshService.exec(`docker logs stereum-${mevboost.id}`);
7878
if (
79-
/Listening on 0.0.0.0:18550/.test(status.stdout) &&
79+
/listening on 0.0.0.0:18550/.test(status.stdout) &&
8080
/using 1 relays/.test(status.stdout) &&
8181
!/Invalid relay URL/.test(status.stdout)
8282
) {
@@ -97,7 +97,7 @@ test("mevboost installation", async () => {
9797
}
9898

9999
// check if Mevboost service is running properly
100-
expect(status.stdout).toMatch(/Listening on 0.0.0.0:18550/);
100+
expect(status.stdout).toMatch(/listening on 0.0.0.0:18550/);
101101
expect(status.stdout).toMatch(/using 1 relays/);
102102
expect(status.stdout).not.toMatch(/Invalid relay URL/);
103103
});

launcher/src/backend/tests/integration/GethService.int.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ServiceManager } from "../../ServiceManager.js";
77
import { TaskManager } from "../../TaskManager.js";
88
const log = require("electron-log");
99

10-
jest.setTimeout(500000);
10+
jest.setTimeout(600000);
1111

1212
test("geth installation", async () => {
1313
const testServer = new HetznerServer();
@@ -56,7 +56,7 @@ test("geth installation", async () => {
5656
await nodeConnection.prepareStereumNode(nodeConnection.settings.stereum.settings.controls_install_path);
5757

5858
//install geth
59-
let executionClient = serviceManager.getService("GethService", { network: "holesky", installDir: "/opt/stereum" });
59+
let executionClient = serviceManager.getService("GethService", { network: "hoodi", installDir: "/opt/stereum" });
6060

6161
let versions = await nodeConnection.nodeUpdates.checkUpdates();
6262
executionClient.imageVersion = versions[executionClient.network][executionClient.service].slice(-1).pop();
@@ -76,7 +76,6 @@ test("geth installation", async () => {
7676
/Started P2P networking/.test(status.stderr) &&
7777
/Starting metrics server/.test(status.stderr) &&
7878
/Loaded JWT secret file/.test(status.stderr) &&
79-
/Looking for peers/.test(status.stderr) &&
8079
/HTTP server started/.test(status.stderr)
8180
) {
8281
condition = true;
@@ -106,6 +105,5 @@ test("geth installation", async () => {
106105
expect(status.stderr).toMatch(/Started P2P networking/);
107106
expect(status.stderr).toMatch(/Starting metrics server/);
108107
expect(status.stderr).toMatch(/Loaded JWT secret file/);
109-
expect(status.stderr).toMatch(/Looking for peers/);
110108
expect(status.stderr).toMatch(/HTTP server started/);
111109
});

launcher/src/backend/tests/integration/GrandineBeaconService.int.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ test("grandine consensus client", async () => {
5656
await nodeConnection.findStereumSettings();
5757
await nodeConnection.prepareStereumNode(nodeConnection.settings.stereum.settings.controls_install_path);
5858

59-
let geth = serviceManager.getService("GethService", { network: "holesky", installDir: "/opt/stereum" });
59+
let geth = serviceManager.getService("GethService", { network: "hoodi", installDir: "/opt/stereum" });
6060

6161
let grandineBC = serviceManager.getService("GrandineBeaconService", {
62-
network: "holesky",
62+
network: "hoodi",
6363
installDir: "/opt/stereum",
6464
executionClients: [geth],
6565
});

launcher/src/backend/tests/integration/L2GethService.int.js

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ test("l2geth installation", async () => {
5858
//install besu
5959
let executionClient = serviceManager.getService("L2GethService", { network: "op-mainnet", installDir: "/opt/stereum" });
6060

61-
let versions = await nodeConnection.nodeUpdates.checkUpdates();
62-
executionClient.imageVersion = versions[executionClient.network][executionClient.service].slice(-1).pop();
61+
// let versions = await nodeConnection.nodeUpdates.checkUpdates();
62+
// executionClient.imageVersion = versions[executionClient.network][executionClient.service].slice(-1).pop();
63+
executionClient.imageVersion = "latest";
6364

6465
await nodeConnection.writeServiceConfiguration(executionClient.buildConfiguration());
6566
await serviceManager.manageServiceState(executionClient.id, "started");
@@ -68,19 +69,22 @@ test("l2geth installation", async () => {
6869
let condition = false;
6970
let counter = 0;
7071
let status = "";
71-
while (!condition && counter < 10) {
72+
let completeStatus = "";
73+
while (!condition && counter < 5) {
7274
await testServer.Sleep(30000);
7375
status = await nodeConnection.sshService.exec(`docker logs stereum-${executionClient.id}`);
76+
completeStatus = status.stdout + status.stderr;
77+
7478
if (
75-
/Starting peer-to-peer node/.test(status.stdout) &&
76-
/Opened ancient database/.test(status.stdout) &&
77-
/Initialised chain configuration/.test(status.stdout) &&
78-
/Loaded most recent local header/.test(status.stdout) &&
79-
/Loaded most recent local full block/.test(status.stdout) &&
80-
/Loaded most recent local fast block/.test(status.stdout) &&
81-
/Started P2P networking/.test(status.stdout) &&
82-
/IPC endpoint opened/.test(status.stdout) &&
83-
/HTTP endpoint opened/.test(status.stdout)
79+
/Starting peer-to-peer node/.test(completeStatus) &&
80+
/Opened ancient database/.test(completeStatus) &&
81+
/Initialised chain configuration/.test(completeStatus) &&
82+
/Loaded most recent local header/.test(completeStatus) &&
83+
/Loaded most recent local full block/.test(completeStatus) &&
84+
/Loaded most recent local fast block/.test(completeStatus) &&
85+
/Started P2P networking/.test(completeStatus) &&
86+
/IPC endpoint opened/.test(completeStatus) &&
87+
/HTTP endpoint opened/.test(completeStatus)
8488
) {
8589
condition = true;
8690
}
@@ -103,13 +107,13 @@ test("l2geth installation", async () => {
103107
expect((docker.stdout.match(new RegExp("Up", "g")) || []).length).toBe(1);
104108
}
105109

106-
expect(status.stdout).toMatch(/Starting peer-to-peer node/);
107-
expect(status.stdout).toMatch(/Opened ancient database/);
108-
expect(status.stdout).toMatch(/Initialised chain configuration/);
109-
expect(status.stdout).toMatch(/Loaded most recent local header/);
110-
expect(status.stdout).toMatch(/Loaded most recent local full block/);
111-
expect(status.stdout).toMatch(/Loaded most recent local fast block/);
112-
expect(status.stdout).toMatch(/Started P2P networking/);
113-
expect(status.stdout).toMatch(/IPC endpoint opened/);
114-
expect(status.stdout).toMatch(/HTTP endpoint opened/);
110+
expect(completeStatus).toMatch(/Starting peer-to-peer node/);
111+
expect(completeStatus).toMatch(/Opened ancient database/);
112+
expect(completeStatus).toMatch(/Initialised chain configuration/);
113+
expect(completeStatus).toMatch(/Loaded most recent local header/);
114+
expect(completeStatus).toMatch(/Loaded most recent local full block/);
115+
expect(completeStatus).toMatch(/Loaded most recent local fast block/);
116+
expect(completeStatus).toMatch(/Started P2P networking/);
117+
expect(completeStatus).toMatch(/IPC endpoint opened/);
118+
expect(completeStatus).toMatch(/HTTP endpoint opened/);
115119
});

launcher/src/backend/tests/integration/LighthouseBeaconService.int.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ test("lighthouse validator import", async () => {
5656
await nodeConnection.findStereumSettings();
5757
await nodeConnection.prepareStereumNode(nodeConnection.settings.stereum.settings.controls_install_path);
5858

59-
let geth = serviceManager.getService("GethService", { network: "holesky", installDir: "/opt/stereum" });
59+
let geth = serviceManager.getService("GethService", { network: "hoodi", installDir: "/opt/stereum" });
6060

6161
let lhBC = serviceManager.getService("LighthouseBeaconService", {
62-
network: "holesky",
62+
network: "hoodi",
6363
installDir: "/opt/stereum",
6464
executionClients: [geth],
6565
});
6666

6767
let lhVC = serviceManager.getService("LighthouseValidatorService", {
68-
network: "holesky",
68+
network: "hoodi",
6969
installDir: "/opt/stereum",
7070
consensusClients: [lhBC],
7171
});
@@ -99,7 +99,8 @@ test("lighthouse validator import", async () => {
9999
],
100100
passwords: ["MyTestPassword", "MyTestPassword", "MyTestPassword"],
101101
});
102-
await validatorAccountManager.importKey(lhVC.id);
102+
const importResult = await validatorAccountManager.importKey(lhVC.id);
103+
log.info(importResult);
103104

104105
//get logs
105106
let condition = false;
@@ -116,15 +117,14 @@ test("lighthouse validator import", async () => {
116117
/HTTP API started/.test(BCstatus.stderr) &&
117118
/Metrics HTTP server started/.test(BCstatus.stderr) &&
118119
/Syncing /.test(BCstatus.stderr) &&
119-
/The execution endpoint is connected and configured, however it is not yet synced/.test(BCstatus.stderr) &&
120+
/Execution endpoint is not synced/.test(BCstatus.stderr) &&
120121
/Successfully loaded graffiti file/.test(VCstatus.stderr) &&
121122
/Starting validator client/.test(VCstatus.stderr) &&
122123
/Metrics HTTP server started/.test(VCstatus.stderr) &&
123124
/Successfully loaded graffiti file/.test(VCstatus.stderr) &&
124125
/Initialized beacon node connections/.test(VCstatus.stderr) &&
125126
/HTTP API started/.test(VCstatus.stderr) &&
126-
/Imported keystores via standard HTTP API, count: 3/.test(VCstatus.stderr) &&
127-
/Enabled validator/.test(VCstatus.stderr)
127+
/Imported keystores via standard HTTP API, count: 3/.test(VCstatus.stderr)
128128
) {
129129
condition = true;
130130
}
@@ -162,7 +162,7 @@ test("lighthouse validator import", async () => {
162162
expect(BCstatus.stderr).toMatch(/HTTP API started/);
163163
expect(BCstatus.stderr).toMatch(/Metrics HTTP server started/);
164164
expect(BCstatus.stderr).toMatch(/Syncing/);
165-
expect(BCstatus.stderr).toMatch(/The execution endpoint is connected and configured, however it is not yet synced/);
165+
expect(BCstatus.stderr).toMatch(/Execution endpoint is not synced/);
166166

167167
//check lighthouse VC logs
168168
expect(VCstatus.stderr).toMatch(/Successfully loaded graffiti file/);
@@ -172,5 +172,4 @@ test("lighthouse validator import", async () => {
172172
expect(VCstatus.stderr).toMatch(/Initialized beacon node connections/);
173173
expect(VCstatus.stderr).toMatch(/HTTP API started/);
174174
expect(VCstatus.stderr).toMatch(/Imported keystores via standard HTTP API, count: 3/);
175-
expect(VCstatus.stderr).toMatch(/Enabled validator/);
176175
});

0 commit comments

Comments
 (0)