Skip to content

Commit

Permalink
Add CI-independent BMO e2e tests
Browse files Browse the repository at this point in the history
Implement lightweight fixture-based tests to ensure CI platform flexibility.
  • Loading branch information
Max Rantil committed Nov 10, 2023
1 parent 74bfd27 commit 91b0184
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 36 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/e2e-fixture-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: E2E Fixture Test

on:
pull_request:
branches: [ main ]
paths-ignore:
- '**/*.md'
- 'docs/**'
- '.gitignore'
- 'LICENSE'

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install Dependencies
run: "${GITHUB_WORKSPACE}/hack/e2e/ensure_cmctl.sh"

- name: Build BMO e2e Docker Image
env:
IMG: quay.io/metal3-io/baremetal-operator:e2e
run: make docker

- name: Set Up Environment and Run BMO e2e Tests
env:
E2E_CONF_FILE: ${GITHUB_WORKSPACE}/test/e2e/config/fixture.yaml
USE_EXISTING_CLUSTER: "false"
run: make test-e2e
7 changes: 0 additions & 7 deletions test/e2e/basic_ops_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,6 @@ var _ = Describe("basic", func() {
err = clusterProxy.GetClient().Create(ctx, &bmh)
Expect(err).NotTo(HaveOccurred())

By("waiting for the BMH to be in registering state")
WaitForBmhInProvisioningState(ctx, WaitForBmhInProvisioningStateInput{
Client: clusterProxy.GetClient(),
Bmh: bmh,
State: metal3api.StateRegistering,
}, e2eConfig.GetIntervals(specName, "wait-registering")...)

By("waiting for the BMH to become available")
WaitForBmhInProvisioningState(ctx, WaitForBmhInProvisioningStateInput{
Client: clusterProxy.GetClient(),
Expand Down
7 changes: 0 additions & 7 deletions test/e2e/basic_provisioning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@ var _ = Describe("Provisioning", func() {
err = clusterProxy.GetClient().Create(ctx, &bmh)
Expect(err).NotTo(HaveOccurred())

By("Waiting for the BMH to be in registering state")
WaitForBmhInProvisioningState(ctx, WaitForBmhInProvisioningStateInput{
Client: clusterProxy.GetClient(),
Bmh: bmh,
State: metal3api.StateRegistering,
}, e2eConfig.GetIntervals(specName, "wait-registering")...)

By("Waiting for the BMH to become available")
WaitForBmhInProvisioningState(ctx, WaitForBmhInProvisioningStateInput{
Client: clusterProxy.GetClient(),
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/config/ironic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ intervals:
default/wait-registering: ["1m", "5s"]
inspection/wait-registration-error: ["1m", "5s"]
external-inspection/wait-available: ["20s", "1s"]
default/wait-inspecting: ["2m", "10s"]
default/wait-inspecting: ["2m", "2s"]
default/wait-available: ["10m", "1s"]
default/wait-deployment: ["5m", "1s"]
default/wait-namespace-deleted: ["10m", "1s"]
Expand Down
7 changes: 0 additions & 7 deletions test/e2e/external_inspection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,6 @@ var _ = Describe("External Inspection", func() {
err = clusterProxy.GetClient().Create(ctx, &bmh)
Expect(err).NotTo(HaveOccurred())

By("waiting for the BMH to be in registering state")
WaitForBmhInProvisioningState(ctx, WaitForBmhInProvisioningStateInput{
Client: clusterProxy.GetClient(),
Bmh: bmh,
State: metal3api.StateRegistering,
}, e2eConfig.GetIntervals(specName, "wait-registering")...)

By("waiting for the BMH to become available")
WaitForBmhInProvisioningState(ctx, WaitForBmhInProvisioningStateInput{
Client: clusterProxy.GetClient(),
Expand Down
7 changes: 0 additions & 7 deletions test/e2e/inspection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,6 @@ var _ = Describe("Inspection", func() {
err = clusterProxy.GetClient().Create(ctx, &bmh)
Expect(err).NotTo(HaveOccurred())

By("waiting for the BMH to be in registering state")
WaitForBmhInProvisioningState(ctx, WaitForBmhInProvisioningStateInput{
Client: clusterProxy.GetClient(),
Bmh: bmh,
State: metal3api.StateRegistering,
}, e2eConfig.GetIntervals(specName, "wait-registering")...)

By("waiting for the BMH to be in inspecting state")
WaitForBmhInProvisioningState(ctx, WaitForBmhInProvisioningStateInput{
Client: clusterProxy.GetClient(),
Expand Down
7 changes: 0 additions & 7 deletions test/e2e/re_inspection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,6 @@ var _ = Describe("Re-Inspection", func() {
err = clusterProxy.GetClient().Create(ctx, &bmh)
Expect(err).NotTo(HaveOccurred())

By("waiting for the BMH to be in registering state")
WaitForBmhInProvisioningState(ctx, WaitForBmhInProvisioningStateInput{
Client: clusterProxy.GetClient(),
Bmh: bmh,
State: metal3api.StateRegistering,
}, e2eConfig.GetIntervals(specName, "wait-registering")...)

By("waiting for the BMH to become available")
WaitForBmhInProvisioningState(ctx, WaitForBmhInProvisioningStateInput{
Client: clusterProxy.GetClient(),
Expand Down

0 comments on commit 91b0184

Please sign in to comment.