-
Notifications
You must be signed in to change notification settings - Fork 0
WIP: AOTC component tests #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
guptagunjan
wants to merge
18
commits into
main
Choose a base branch
from
gg/ITEP-76335
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
a1b2eec
AOTC component tests
guptagunjan a61b99d
update version
guptagunjan 1c832a1
Potential fix for code scanning alert no. 34: Workflow does not conta…
guptagunjan 627ad3c
fix trivy issues
guptagunjan 5760238
fix test target
guptagunjan 408549e
Merge branch 'gg/ITEP-76335' of https://github.com/open-edge-platform…
guptagunjan f9354f8
fix ci issues
guptagunjan 001c848
more ci issues
guptagunjan aaccdb1
fix zizimor issue
guptagunjan c733099
migrate tests to use VIP
guptagunjan 5d81508
tests using vip on orchestrator
guptagunjan 5662b4d
fix ci
guptagunjan c0609a2
test using real orch
guptagunjan 129cef9
fix lint
guptagunjan f1c8ad9
try fixing ci trigger
guptagunjan 012a9dc
update password
guptagunjan d2a10b9
attempt ci runner fix
guptagunjan dbe449d
updating component test
guptagunjan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,146 @@ | ||
| # SPDX-FileCopyrightText: (C) 2025 Intel Corporation | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: Component Tests | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
|
|
||
| env: | ||
| # Test environment configuration | ||
| HARBOR_SERVER: https://harbor.kind.internal | ||
| HARBOR_NAMESPACE: harbor | ||
| HARBOR_ADMIN_CREDENTIAL: admin-secret | ||
| KEYCLOAK_SERVER: https://keycloak.kind.internal | ||
| KEYCLOAK_NAMESPACE: keycloak | ||
| KEYCLOAK_SECRET: keycloak-secret | ||
| VAULT_SERVER: https://vault.kind.internal | ||
| CATALOG_SERVER: https://catalog.kind.internal | ||
| ADM_SERVER: https://adm.kind.internal | ||
| RS_ROOT_URL: oci://registry.kind.internal | ||
| RS_PROXY_ROOT_URL: https://registry.kind.internal | ||
| MANIFEST_PATH: /manifests | ||
| MANIFEST_TAG: latest | ||
| REGISTRY_HOST_EXTERNAL: https://harbor.kind.internal | ||
| SERVICE_ACCOUNT: default | ||
|
|
||
| jobs: | ||
| component-tests: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 45 | ||
|
|
||
| strategy: | ||
| matrix: | ||
| go-version: ['1.21', '1.22'] | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Go ${{ matrix.go-version }} | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: ${{ matrix.go-version }} | ||
|
|
||
| - name: Cache Go modules | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.cache/go-build | ||
| ~/go/pkg/mod | ||
| key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-go-${{ matrix.go-version }}- | ||
|
|
||
| - name: Create KinD cluster | ||
| uses: helm/[email protected] | ||
| with: | ||
| cluster_name: kind | ||
| config: test/config/kind-config.yaml | ||
|
|
||
| - name: Install kubectl | ||
| uses: azure/setup-kubectl@v4 | ||
| with: | ||
| version: 'v1.29.0' | ||
|
|
||
| - name: Install Helm | ||
| uses: azure/setup-helm@v4 | ||
| with: | ||
| version: '3.13.0' | ||
|
|
||
| - name: Set up test infrastructure | ||
| run: | | ||
| # Install required CRDs and services for testing | ||
| kubectl create namespace harbor --dry-run=client -o yaml | kubectl apply -f - | ||
| kubectl create namespace keycloak --dry-run=client -o yaml | kubectl apply -f - | ||
| kubectl create namespace orch-app --dry-run=client -o yaml | kubectl apply -f - | ||
|
|
||
| # Create mock services for testing | ||
| kubectl apply -f test/manifests/test-services.yaml | ||
|
|
||
| - name: Wait for test infrastructure | ||
| run: | | ||
| # Wait for mock services to be ready | ||
| kubectl wait --for=condition=available --timeout=300s deployment/mock-harbor -n harbor | ||
| kubectl wait --for=condition=available --timeout=300s deployment/mock-keycloak -n keycloak | ||
| kubectl wait --for=condition=available --timeout=300s deployment/mock-catalog -n orch-app | ||
|
|
||
| - name: Set up port forwarding | ||
| run: | | ||
| # Set up port forwarding for test services | ||
| kubectl port-forward -n harbor svc/mock-harbor 8080:80 & | ||
| kubectl port-forward -n keycloak svc/mock-keycloak 8081:80 & | ||
| kubectl port-forward -n orch-app svc/mock-catalog 8082:80 & | ||
| sleep 10 # Give port forwarding time to establish | ||
|
|
||
| - name: Download dependencies | ||
| run: | | ||
| go mod download | ||
| go mod vendor | ||
|
|
||
| - name: Build application | ||
| run: | | ||
| make go-build | ||
|
|
||
| - name: Run unit tests | ||
| run: | | ||
| make go-test | ||
|
|
||
| - name: Run component tests | ||
| run: | | ||
| make component-test | ||
|
|
||
| - name: Run component tests with coverage | ||
| run: | | ||
| make component-test-coverage | ||
|
|
||
| - name: Upload coverage reports | ||
| uses: codecov/codecov-action@v4 | ||
| with: | ||
| files: ./coverage.xml,./component-coverage.xml | ||
| flags: component-tests | ||
| name: component-coverage | ||
| fail_ci_if_error: false | ||
|
|
||
| - name: Archive test results | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: component-test-results-go${{ matrix.go-version }} | ||
| path: | | ||
| coverage.xml | ||
| component-coverage.xml | ||
| *.log | ||
|
|
||
| - name: Cleanup | ||
| if: always() | ||
| run: | | ||
| # Kill port forwarding processes | ||
| pkill -f "kubectl port-forward" || true | ||
| # Additional cleanup if needed | ||
| kubectl delete namespace harbor keycloak orch-app --ignore-not-found=true | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ bin/ | |
| vendor/ | ||
| build/_output/ | ||
| coverage.* | ||
| component-coverage.* | ||
| venv-env/ | ||
| ci/ | ||
| artifacts/ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 0.4.3-dev | ||
| 0.4.3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| // SPDX-FileCopyrightText: (C) 2025 Intel Corporation | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| package component | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/suite" | ||
| ) | ||
|
|
||
| // TestComponentTests is the main test runner for component tests | ||
| func TestComponentTests(t *testing.T) { | ||
| t.Log("🎯 Running Component Tests for App Orchestration Tenant Controller") | ||
| t.Log("") | ||
| t.Log("Component tests validate:") | ||
| t.Log(" ✓ Plugin integration (Harbor, Catalog, Extensions)") | ||
| t.Log(" ✓ Manager event handling and project lifecycle") | ||
| t.Log(" ✓ Nexus hook integration and watcher management") | ||
| t.Log(" ✓ Southbound service communications") | ||
| t.Log(" ✓ Error handling and recovery scenarios") | ||
| t.Log(" ✓ Concurrent operations and thread safety") | ||
| t.Log("") | ||
|
|
||
| // Run plugin component tests | ||
| t.Run("PluginComponents", func(t *testing.T) { | ||
| suite.Run(t, new(PluginComponentTests)) | ||
| }) | ||
|
|
||
| // Run manager component tests | ||
| t.Run("ManagerComponents", func(t *testing.T) { | ||
| suite.Run(t, new(ManagerComponentTests)) | ||
| }) | ||
|
|
||
| // Run nexus hook component tests | ||
| t.Run("NexusHookComponents", func(t *testing.T) { | ||
| suite.Run(t, new(NexusHookComponentTests)) | ||
| }) | ||
|
|
||
| // Run southbound component tests | ||
| t.Run("SouthboundComponents", func(t *testing.T) { | ||
| suite.Run(t, new(SouthboundComponentTests)) | ||
| }) | ||
|
|
||
| t.Log("") | ||
| t.Log("🎉 Component Test Suite Complete") | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.