Skip to content

Commit 3f05b34

Browse files
committed
test: run Omni as part of integration tests
This enables test coverage, builds Omni with race detector. Also redone the COSI state creation flow: no more callbacks. The state is now an Object, which has `Stop` method, that should be called when the app stops. All defers were moved into the `Stop` method basically. Signed-off-by: Artem Chernyshev <[email protected]>
1 parent a36d357 commit 3f05b34

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1382
-961
lines changed

.github/workflows/ci.yaml

Lines changed: 58 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-06-06T17:20:38Z by kres fc6afbe-dirty.
3+
# Generated on 2025-06-09T15:23:59Z by kres 37c4809-dirty.
44

55
name: default
66
concurrency:
@@ -99,10 +99,58 @@ jobs:
9999
- name: unit-tests-race
100100
run: |
101101
make unit-tests-race
102+
- name: run-integration-test
103+
if: github.event_name == 'pull_request'
104+
env:
105+
INTEGRATION_RUN_E2E_TEST: "true"
106+
INTEGRATION_TEST_ARGS: --test.run TestIntegration/Suites/(CleanState|Auth|DefaultCluster|CLICommands)$
107+
RUN_TALEMU_TESTS: "true"
108+
TALEMU_TEST_ARGS: --test.run TestIntegration/Suites/(ImmediateClusterDestruction|EncryptedCluster|SinglenodeCluster|ScaleUpAndDown|ScaleUpAndDownMachineClassBasedMachineSets|TalosUpgrades|KubernetesUpgrades|MaintenanceUpgrade|ClusterTemplate|ScaleUpAndDownAutoProvisionMachineSets)$
109+
WITH_DEBUG: "true"
110+
WITH_RACE: "true"
111+
run: |
112+
sudo -E make run-integration-test
113+
- name: Retrieve PR labels
114+
id: retrieve-pr-labels
115+
uses: actions/github-script@v7
116+
with:
117+
retries: "3"
118+
script: |
119+
if (context.eventName != "pull_request") { return "[]" }
120+
121+
const resp = await github.rest.issues.get({
122+
issue_number: context.issue.number,
123+
owner: context.repo.owner,
124+
repo: context.repo.repo,
125+
})
126+
127+
return resp.data.labels.map(label => label.name)
128+
- name: Generate executable list
129+
run: |
130+
find _out -type f -executable > _out/executable-artifacts
131+
- name: save-artifacts
132+
uses: actions/upload-artifact@v4
133+
with:
134+
name: artifacts
135+
path: |-
136+
_out
137+
!_out/etcd
138+
!_out/secondary-storage/**
139+
retention-days: "5"
140+
- name: save-integration-test-artifacts
141+
if: always()
142+
uses: actions/upload-artifact@v4
143+
with:
144+
name: integration-test
145+
path: |-
146+
~/.talos/clusters/**/*.log
147+
!~/.talos/clusters/**/swtpm.log
148+
/tmp/integration-test
149+
retention-days: "5"
102150
- name: coverage
103151
uses: codecov/codecov-action@v5
104152
with:
105-
files: _out/coverage-unit-tests-client.txt,_out/coverage-unit-tests.txt
153+
files: _out/coverage-unit-tests-client.txt,_out/coverage-unit-tests.txt,_out/coverage-emulator.txt,_out/coverage-integration.txt
106154
token: ${{ secrets.CODECOV_TOKEN }}
107155
timeout-minutes: 3
108156
- name: acompat
@@ -169,53 +217,6 @@ jobs:
169217
PUSH: "true"
170218
run: |
171219
make image-omni-integration-test IMAGE_TAG=latest
172-
- name: run-integration-test
173-
if: github.event_name == 'pull_request'
174-
env:
175-
INTEGRATION_RUN_E2E_TEST: "true"
176-
INTEGRATION_TEST_ARGS: --test.run TestIntegration/Suites/(CleanState|Auth|DefaultCluster|CLICommands)$
177-
RUN_TALEMU_TESTS: "true"
178-
TALEMU_TEST_ARGS: --test.run TestIntegration/Suites/(ImmediateClusterDestruction|EncryptedCluster|SinglenodeCluster|ScaleUpAndDown|ScaleUpAndDownMachineClassBasedMachineSets|TalosUpgrades|KubernetesUpgrades|MaintenanceUpgrade|ClusterTemplate|ScaleUpAndDownAutoProvisionMachineSets)$
179-
WITH_DEBUG: "true"
180-
run: |
181-
sudo -E make run-integration-test
182-
- name: Retrieve PR labels
183-
id: retrieve-pr-labels
184-
uses: actions/github-script@v7
185-
with:
186-
retries: "3"
187-
script: |
188-
if (context.eventName != "pull_request") { return "[]" }
189-
190-
const resp = await github.rest.issues.get({
191-
issue_number: context.issue.number,
192-
owner: context.repo.owner,
193-
repo: context.repo.repo,
194-
})
195-
196-
return resp.data.labels.map(label => label.name)
197-
- name: Generate executable list
198-
run: |
199-
find _out -type f -executable > _out/executable-artifacts
200-
- name: save-artifacts
201-
uses: actions/upload-artifact@v4
202-
with:
203-
name: artifacts
204-
path: |-
205-
_out
206-
!_out/etcd
207-
!_out/secondary-storage/**
208-
retention-days: "5"
209-
- name: save-integration-test-artifacts
210-
if: always()
211-
uses: actions/upload-artifact@v4
212-
with:
213-
name: integration-test
214-
path: |-
215-
~/.talos/clusters/**/*.log
216-
!~/.talos/clusters/**/swtpm.log
217-
/tmp/integration-test
218-
retention-days: "5"
219220
- name: Generate Checksums
220221
if: startsWith(github.ref, 'refs/tags/')
221222
run: |
@@ -302,6 +303,7 @@ jobs:
302303
RUN_TALEMU_TESTS: "false"
303304
TALEMU_TEST_ARGS: --test.run TestIntegration/Suites/(ImmediateClusterDestruction|EncryptedCluster|SinglenodeCluster|ScaleUpAndDown|ScaleUpAndDownMachineClassBasedMachineSets|TalosUpgrades|KubernetesUpgrades|MaintenanceUpgrade|ClusterTemplate|ScaleUpAndDownAutoProvisionMachineSets)$
304305
WITH_DEBUG: "true"
306+
WITH_RACE: "true"
305307
run: |
306308
sudo -E make run-integration-test
307309
- name: save-integration-test-artifacts
@@ -381,6 +383,7 @@ jobs:
381383
RUN_TALEMU_TESTS: "false"
382384
TALEMU_TEST_ARGS: --test.run TestIntegration/Suites/(ImmediateClusterDestruction|EncryptedCluster|SinglenodeCluster|ScaleUpAndDown|ScaleUpAndDownMachineClassBasedMachineSets|TalosUpgrades|KubernetesUpgrades|MaintenanceUpgrade|ClusterTemplate|ScaleUpAndDownAutoProvisionMachineSets)$
383385
WITH_DEBUG: "true"
386+
WITH_RACE: "true"
384387
run: |
385388
sudo -E make run-integration-test
386389
- name: save-integration-test-artifacts
@@ -460,6 +463,7 @@ jobs:
460463
RUN_TALEMU_TESTS: "false"
461464
TALEMU_TEST_ARGS: --test.run TestIntegration/Suites/(ImmediateClusterDestruction|EncryptedCluster|SinglenodeCluster|ScaleUpAndDown|ScaleUpAndDownMachineClassBasedMachineSets|TalosUpgrades|KubernetesUpgrades|MaintenanceUpgrade|ClusterTemplate|ScaleUpAndDownAutoProvisionMachineSets)$
462465
WITH_DEBUG: "true"
466+
WITH_RACE: "true"
463467
run: |
464468
sudo -E make run-integration-test
465469
- name: save-integration-test-artifacts
@@ -539,6 +543,7 @@ jobs:
539543
RUN_TALEMU_TESTS: "false"
540544
TALEMU_TEST_ARGS: --test.run TestIntegration/Suites/(ImmediateClusterDestruction|EncryptedCluster|SinglenodeCluster|ScaleUpAndDown|ScaleUpAndDownMachineClassBasedMachineSets|TalosUpgrades|KubernetesUpgrades|MaintenanceUpgrade|ClusterTemplate|ScaleUpAndDownAutoProvisionMachineSets)$
541545
WITH_DEBUG: "true"
546+
WITH_RACE: "true"
542547
run: |
543548
sudo -E make run-integration-test
544549
- name: save-integration-test-artifacts
@@ -619,6 +624,7 @@ jobs:
619624
RUN_TALEMU_TESTS: "false"
620625
TALEMU_TEST_ARGS: --test.run TestIntegration/Suites/(ImmediateClusterDestruction|EncryptedCluster|SinglenodeCluster|ScaleUpAndDown|ScaleUpAndDownMachineClassBasedMachineSets|TalosUpgrades|KubernetesUpgrades|MaintenanceUpgrade|ClusterTemplate|ScaleUpAndDownAutoProvisionMachineSets)$
621626
WITH_DEBUG: "true"
627+
WITH_RACE: "true"
622628
run: |
623629
sudo -E make run-integration-test
624630
- name: save-integration-test-artifacts
@@ -698,6 +704,7 @@ jobs:
698704
RUN_TALEMU_TESTS: "false"
699705
TALEMU_TEST_ARGS: --test.run TestIntegration/Suites/(ImmediateClusterDestruction|EncryptedCluster|SinglenodeCluster|ScaleUpAndDown|ScaleUpAndDownMachineClassBasedMachineSets|TalosUpgrades|KubernetesUpgrades|MaintenanceUpgrade|ClusterTemplate|ScaleUpAndDownAutoProvisionMachineSets)$
700706
WITH_DEBUG: "true"
707+
WITH_RACE: "true"
701708
run: |
702709
sudo -E make run-integration-test
703710
- name: save-integration-test-artifacts
@@ -777,6 +784,7 @@ jobs:
777784
RUN_TALEMU_TESTS: "false"
778785
TALEMU_TEST_ARGS: --test.run TestIntegration/Suites/(ImmediateClusterDestruction|EncryptedCluster|SinglenodeCluster|ScaleUpAndDown|ScaleUpAndDownMachineClassBasedMachineSets|TalosUpgrades|KubernetesUpgrades|MaintenanceUpgrade|ClusterTemplate|ScaleUpAndDownAutoProvisionMachineSets)$
779786
WITH_DEBUG: "true"
787+
WITH_RACE: "true"
780788
run: |
781789
sudo -E make run-integration-test
782790
- name: save-integration-test-artifacts
@@ -856,6 +864,7 @@ jobs:
856864
RUN_TALEMU_TESTS: "false"
857865
TALEMU_TEST_ARGS: --test.run TestIntegration/Suites/(ImmediateClusterDestruction|EncryptedCluster|SinglenodeCluster|ScaleUpAndDown|ScaleUpAndDownMachineClassBasedMachineSets|TalosUpgrades|KubernetesUpgrades|MaintenanceUpgrade|ClusterTemplate|ScaleUpAndDownAutoProvisionMachineSets)$
858866
WITH_DEBUG: "true"
867+
WITH_RACE: "true"
859868
run: |
860869
sudo -E make run-integration-test
861870
- name: save-integration-test-artifacts

.github/workflows/e2e-backups-cron.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-06-06T17:20:38Z by kres fc6afbe-dirty.
3+
# Generated on 2025-06-09T15:23:59Z by kres 37c4809-dirty.
44

55
name: e2e-backups-cron
66
concurrency:
@@ -65,6 +65,7 @@ jobs:
6565
RUN_TALEMU_TESTS: "false"
6666
TALEMU_TEST_ARGS: --test.run TestIntegration/Suites/(ImmediateClusterDestruction|EncryptedCluster|SinglenodeCluster|ScaleUpAndDown|ScaleUpAndDownMachineClassBasedMachineSets|TalosUpgrades|KubernetesUpgrades|MaintenanceUpgrade|ClusterTemplate|ScaleUpAndDownAutoProvisionMachineSets)$
6767
WITH_DEBUG: "true"
68+
WITH_RACE: "true"
6869
run: |
6970
sudo -E make run-integration-test
7071
- name: save-integration-test-artifacts

.github/workflows/e2e-forced-removal-cron.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-06-06T17:20:38Z by kres fc6afbe-dirty.
3+
# Generated on 2025-06-09T15:23:59Z by kres 37c4809-dirty.
44

55
name: e2e-forced-removal-cron
66
concurrency:
@@ -65,6 +65,7 @@ jobs:
6565
RUN_TALEMU_TESTS: "false"
6666
TALEMU_TEST_ARGS: --test.run TestIntegration/Suites/(ImmediateClusterDestruction|EncryptedCluster|SinglenodeCluster|ScaleUpAndDown|ScaleUpAndDownMachineClassBasedMachineSets|TalosUpgrades|KubernetesUpgrades|MaintenanceUpgrade|ClusterTemplate|ScaleUpAndDownAutoProvisionMachineSets)$
6767
WITH_DEBUG: "true"
68+
WITH_RACE: "true"
6869
run: |
6970
sudo -E make run-integration-test
7071
- name: save-integration-test-artifacts

.github/workflows/e2e-scaling-cron.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-06-06T17:20:38Z by kres fc6afbe-dirty.
3+
# Generated on 2025-06-09T15:23:59Z by kres 37c4809-dirty.
44

55
name: e2e-scaling-cron
66
concurrency:
@@ -65,6 +65,7 @@ jobs:
6565
RUN_TALEMU_TESTS: "false"
6666
TALEMU_TEST_ARGS: --test.run TestIntegration/Suites/(ImmediateClusterDestruction|EncryptedCluster|SinglenodeCluster|ScaleUpAndDown|ScaleUpAndDownMachineClassBasedMachineSets|TalosUpgrades|KubernetesUpgrades|MaintenanceUpgrade|ClusterTemplate|ScaleUpAndDownAutoProvisionMachineSets)$
6767
WITH_DEBUG: "true"
68+
WITH_RACE: "true"
6869
run: |
6970
sudo -E make run-integration-test
7071
- name: save-integration-test-artifacts

.github/workflows/e2e-short-cron.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-06-06T17:20:38Z by kres fc6afbe-dirty.
3+
# Generated on 2025-06-09T15:23:59Z by kres 37c4809-dirty.
44

55
name: e2e-short-cron
66
concurrency:
@@ -65,6 +65,7 @@ jobs:
6565
RUN_TALEMU_TESTS: "false"
6666
TALEMU_TEST_ARGS: --test.run TestIntegration/Suites/(ImmediateClusterDestruction|EncryptedCluster|SinglenodeCluster|ScaleUpAndDown|ScaleUpAndDownMachineClassBasedMachineSets|TalosUpgrades|KubernetesUpgrades|MaintenanceUpgrade|ClusterTemplate|ScaleUpAndDownAutoProvisionMachineSets)$
6767
WITH_DEBUG: "true"
68+
WITH_RACE: "true"
6869
run: |
6970
sudo -E make run-integration-test
7071
- name: save-integration-test-artifacts

.github/workflows/e2e-short-secureboot-cron.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-06-06T17:20:38Z by kres fc6afbe-dirty.
3+
# Generated on 2025-06-09T15:23:59Z by kres 37c4809-dirty.
44

55
name: e2e-short-secureboot-cron
66
concurrency:
@@ -66,6 +66,7 @@ jobs:
6666
RUN_TALEMU_TESTS: "false"
6767
TALEMU_TEST_ARGS: --test.run TestIntegration/Suites/(ImmediateClusterDestruction|EncryptedCluster|SinglenodeCluster|ScaleUpAndDown|ScaleUpAndDownMachineClassBasedMachineSets|TalosUpgrades|KubernetesUpgrades|MaintenanceUpgrade|ClusterTemplate|ScaleUpAndDownAutoProvisionMachineSets)$
6868
WITH_DEBUG: "true"
69+
WITH_RACE: "true"
6970
run: |
7071
sudo -E make run-integration-test
7172
- name: save-integration-test-artifacts

.github/workflows/e2e-templates-cron.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-06-06T17:20:38Z by kres fc6afbe-dirty.
3+
# Generated on 2025-06-09T15:23:59Z by kres 37c4809-dirty.
44

55
name: e2e-templates-cron
66
concurrency:
@@ -65,6 +65,7 @@ jobs:
6565
RUN_TALEMU_TESTS: "false"
6666
TALEMU_TEST_ARGS: --test.run TestIntegration/Suites/(ImmediateClusterDestruction|EncryptedCluster|SinglenodeCluster|ScaleUpAndDown|ScaleUpAndDownMachineClassBasedMachineSets|TalosUpgrades|KubernetesUpgrades|MaintenanceUpgrade|ClusterTemplate|ScaleUpAndDownAutoProvisionMachineSets)$
6767
WITH_DEBUG: "true"
68+
WITH_RACE: "true"
6869
run: |
6970
sudo -E make run-integration-test
7071
- name: save-integration-test-artifacts

.github/workflows/e2e-upgrades-cron.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-06-06T17:20:38Z by kres fc6afbe-dirty.
3+
# Generated on 2025-06-09T15:23:59Z by kres 37c4809-dirty.
44

55
name: e2e-upgrades-cron
66
concurrency:
@@ -65,6 +65,7 @@ jobs:
6565
RUN_TALEMU_TESTS: "false"
6666
TALEMU_TEST_ARGS: --test.run TestIntegration/Suites/(ImmediateClusterDestruction|EncryptedCluster|SinglenodeCluster|ScaleUpAndDown|ScaleUpAndDownMachineClassBasedMachineSets|TalosUpgrades|KubernetesUpgrades|MaintenanceUpgrade|ClusterTemplate|ScaleUpAndDownAutoProvisionMachineSets)$
6767
WITH_DEBUG: "true"
68+
WITH_RACE: "true"
6869
run: |
6970
sudo -E make run-integration-test
7071
- name: save-integration-test-artifacts

.github/workflows/e2e-workload-proxy-cron.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
22
#
3-
# Generated on 2025-06-06T17:20:38Z by kres fc6afbe-dirty.
3+
# Generated on 2025-06-09T15:23:59Z by kres 37c4809-dirty.
44

55
name: e2e-workload-proxy-cron
66
concurrency:
@@ -65,6 +65,7 @@ jobs:
6565
RUN_TALEMU_TESTS: "false"
6666
TALEMU_TEST_ARGS: --test.run TestIntegration/Suites/(ImmediateClusterDestruction|EncryptedCluster|SinglenodeCluster|ScaleUpAndDown|ScaleUpAndDownMachineClassBasedMachineSets|TalosUpgrades|KubernetesUpgrades|MaintenanceUpgrade|ClusterTemplate|ScaleUpAndDownAutoProvisionMachineSets)$
6767
WITH_DEBUG: "true"
68+
WITH_RACE: "true"
6869
run: |
6970
sudo -E make run-integration-test
7071
- name: save-integration-test-artifacts

.kres.yaml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,15 @@ spec:
4646
- self-hosted
4747
- omni
4848
---
49+
kind: service.CodeCov
50+
spec:
51+
inputPaths:
52+
- coverage-emulator.txt
53+
- coverage-integration.txt
54+
---
4955
kind: auto.CustomSteps
5056
spec:
5157
steps:
52-
- name: dev-server
53-
toplevel: true
5458
- name: docker-compose-up
5559
toplevel: true
5660
- name: docker-compose-down
@@ -63,15 +67,8 @@ spec:
6367
toplevel: true
6468
- name: run-integration-test
6569
toplevel: true
66-
---
67-
kind: custom.Step
68-
name: dev-server
69-
spec:
70-
makefile:
71-
enabled: true
72-
phony: true
73-
script:
74-
- hack/dev-server.sh
70+
dependants:
71+
- coverage
7572
---
7673
kind: custom.Step
7774
name: docker-compose-up
@@ -212,6 +209,7 @@ spec:
212209
- "/tmp/integration-test"
213210
environment:
214211
WITH_DEBUG: "true"
212+
WITH_RACE: "true"
215213
INTEGRATION_RUN_E2E_TEST: "true"
216214
INTEGRATION_TEST_ARGS: "--test.run TestIntegration/Suites/(CleanState|Auth|DefaultCluster|CLICommands)$"
217215
TALEMU_TEST_ARGS: "--test.run TestIntegration/Suites/(ImmediateClusterDestruction|EncryptedCluster|SinglenodeCluster|ScaleUpAndDown|ScaleUpAndDownMachineClassBasedMachineSets|TalosUpgrades|KubernetesUpgrades|MaintenanceUpgrade|ClusterTemplate|ScaleUpAndDownAutoProvisionMachineSets)$"

0 commit comments

Comments
 (0)