Skip to content

Commit

Permalink
Create an istio registry per primary (#6891)
Browse files Browse the repository at this point in the history
Part of Multi-primary support
- #6432
- #5692
  • Loading branch information
nrfox committed Dec 7, 2023
1 parent 2ed984f commit d8631a1
Show file tree
Hide file tree
Showing 60 changed files with 2,014 additions and 1,576 deletions.
@@ -0,0 +1,83 @@
name: Integration Tests Frontend

on:
workflow_call:
inputs:
target_branch:
required: true
type: string
build_branch:
required: true
type: string
istio_version:
required: false
type: string
default: ""

env:
TARGET_BRANCH: ${{ inputs.target_branch }}

jobs:
integration_tests_frontend_multicluster_multi_primary:
name: Cypress integration tests
runs-on: ubuntu-20.04
env:
# Copied from: https://github.com/bahmutov/cypress-gh-action-split-install/blob/ca3916d4e7240ebdc337825d2d78eb354855464b/.github/workflows/tests.yml#L7-L11
# prevents extra Cypress installation progress messages
CI: 1
# avoid warnings like "tput: No value for $TERM and no -T specified"
TERM: xterm
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: ${{ inputs.build_branch }}

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "18"
cache: yarn
cache-dependency-path: frontend/yarn.lock

- name: Download go binary
uses: actions/download-artifact@v3
with:
name: kiali
path: ~/go/bin/

- name: Ensure kiali binary is executable
run: chmod +x ~/go/bin/kiali

- name: Download frontend build
uses: actions/download-artifact@v3
with:
name: build
path: frontend/build

# Need to install frontend dependencies to run cypress tests.
- name: Install frontend dependencies
working-directory: ./frontend
run: yarn install --frozen-lockfile

- name: Run frontend multi-cluster integration tests
run: hack/run-integration-tests.sh --test-suite frontend-multi-primary $(if [ -n "${{ inputs.istio_version }}" ]; then echo "--istio-version ${{ inputs.istio_version }}"; fi)

- name: Get debug info when integration tests fail
if: failure()
run: |
kubectl --context kind-east logs -l app.kubernetes.io/name=kiali --tail=-1 --all-containers -n istio-system
kubectl --context kind-east describe nodes
kubectl --context kind-east get pods -l app.kubernetes.io/name=kiali -n istio-system -o yaml
kubectl --context kind-east describe pods -n metallb-system
kubectl --context kind-east logs -p deployments/controller -n metallb-system
kubectl --context kind-east logs -p ds/speaker -n metallb-system
kubectl --context kind-east logs deployments/controller -n metallb-system
kubectl --context kind-east logs ds/speaker -n metallb-system
- name: Upload cypress screenshots when tests fail
uses: actions/upload-artifact@v3
if: failure()
with:
name: cypress-screenshots
path: frontend/cypress/screenshots
Expand Up @@ -61,7 +61,7 @@ jobs:
run: yarn install --frozen-lockfile

- name: Run frontend multi-cluster integration tests
run: hack/run-integration-tests.sh --test-suite frontend-multi-cluster $(if [ -n "${{ inputs.istio_version }}" ]; then echo "--istio-version ${{ inputs.istio_version }}"; fi)
run: hack/run-integration-tests.sh --test-suite frontend-primary-remote $(if [ -n "${{ inputs.istio_version }}" ]; then echo "--istio-version ${{ inputs.istio_version }}"; fi)

- name: Get debug info when integration tests fail
if: failure()
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/kiali-ci.yml
Expand Up @@ -78,9 +78,17 @@ jobs:
target_branch: ${{ needs.initialize.outputs.target-branch }}
build_branch: ${{ needs.initialize.outputs.build-branch }}

integration_tests_frontend_multicluster:
name: Run frontend multicluster integration tests
uses: ./.github/workflows/integration-tests-frontend-multicluster.yml
integration_tests_frontend_multicluster_primary_remote:
name: Run frontend multicluster primary-remote integration tests
uses: ./.github/workflows/integration-tests-frontend-multicluster-primary-remote.yml
needs: [initialize, build_backend, build_frontend]
with:
target_branch: ${{ needs.initialize.outputs.target-branch }}
build_branch: ${{ needs.initialize.outputs.build-branch }}

integration_tests_frontend_multicluster_multi_primary:
name: Run frontend multicluster multi-primary integration tests
uses: ./.github/workflows/integration-tests-frontend-multicluster-multi-primary.yml
needs: [initialize, build_backend, build_frontend]
with:
target_branch: ${{ needs.initialize.outputs.target-branch }}
Expand Down
9 changes: 7 additions & 2 deletions business/apps_test.go
Expand Up @@ -62,6 +62,7 @@ func TestGetAppListFromDeployments(t *testing.T) {

func TestGetAppFromDeployments(t *testing.T) {
assert := assert.New(t)
require := require.New(t)

conf := config.NewConfig()
conf.ExternalServices.CustomDashboards.Enabled = false
Expand Down Expand Up @@ -91,7 +92,7 @@ func TestGetAppFromDeployments(t *testing.T) {

criteria := AppCriteria{Namespace: "Namespace", AppName: "httpbin", Cluster: conf.KubernetesConfig.ClusterName}
appDetails, appDetailsErr := svc.GetAppDetails(context.TODO(), criteria)
assert.NoError(appDetailsErr)
require.NoError(appDetailsErr)

assert.Equal("Namespace", appDetails.Namespace.Name)
assert.Equal("httpbin", appDetails.Name)
Expand Down Expand Up @@ -137,8 +138,12 @@ func TestGetAppListFromReplicaSets(t *testing.T) {

func TestGetAppFromReplicaSets(t *testing.T) {
assert := assert.New(t)

// Disabling CustomDashboards on Workload details testing
// otherwise this adds 10s to the test due to an http timeout.
conf := config.NewConfig()
config.Set(conf)
conf.ExternalServices.CustomDashboards.Enabled = false
kubernetes.SetConfig(t, *conf)

// Setup mocks
objects := []runtime.Object{
Expand Down

0 comments on commit d8631a1

Please sign in to comment.