Skip to content

Commit

Permalink
Update e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
anujc25 committed Oct 2, 2024
1 parent 7913534 commit 659e0cd
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 6 deletions.
1 change: 0 additions & 1 deletion .github/workflows/cli-coexistence_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
- "v[0-9]+.[0-9]+.[0-9]+-*"
- "test/e2e/framework/v[0-9]+.[0-9]+.[0-9]+"
- "test/e2e/framework/v[0-9]+.[0-9]+.[0-9]+-*"

jobs:
build-and-run:
name: Tanzu CLI Coexistence Tests
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/cli_core_e2e_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ on:
- "v[0-9]+.[0-9]+.[0-9]+-*"
- "test/e2e/framework/v[0-9]+.[0-9]+.[0-9]+"
- "test/e2e/framework/v[0-9]+.[0-9]+.[0-9]+-*"

env:
TANZU_CLI_E2E_TEST_CENTRAL_REPO_PASSWORD: ${{ secrets.GH_TOKEN_FOR_GHCR }}

jobs:
build:
name: Tanzu CLI Core E2E Tests
Expand Down Expand Up @@ -38,6 +40,13 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN_FOR_GHCR }}

- name: Setup gcloud account
env:
GCP_SA: ${{ secrets.GCP_SA }}
Expand Down
8 changes: 7 additions & 1 deletion test/e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ TANZU_CLI_TMC_UNSTABLE_URL = ""
endif

ifndef TANZU_CLI_E2E_TEST_CENTRAL_REPO_URL
TANZU_CLI_E2E_TEST_CENTRAL_REPO_URL = gcr.io/eminent-nation-87317/tanzu-cli/test/v1/plugins/plugin-inventory:latest
TANZU_CLI_E2E_TEST_CENTRAL_REPO_URL = ghcr.io/vmware-tanzu/tanzu-cli/test/v1/plugins/plugin-inventory:latest
endif

ifndef TANZU_CLI_E2E_TEST_CENTRAL_REPO_PASSWORD
TANZU_CLI_E2E_TEST_CENTRAL_REPO_PASSWORD = ""
endif

ifndef TANZU_CLI_E2E_TEST_LOCAL_CENTRAL_REPO_HOST
Expand Down Expand Up @@ -85,6 +89,8 @@ e2e-plugin-compatibility-tests:
export TANZU_CLI_PLUGIN_DISCOVERY_IMAGE_SIGNATURE_VERIFICATION_SKIP_LIST=$(TANZU_CLI_E2E_TEST_CENTRAL_REPO_URL) ; \
export TANZU_CLI_CEIP_OPT_IN_PROMPT_ANSWER="No" ; \
export TANZU_CLI_EULA_PROMPT_ANSWER="Yes" ; \
export TANZU_CLI_AUTHENTICATED_REGISTRY=ghcr.io ; \
export TANZU_CLI_E2E_TEST_CENTRAL_REPO_PASSWORD=${TANZU_CLI_E2E_TEST_CENTRAL_REPO_PASSWORD}; \
${GINKGO} --keep-going --output-dir ${ROOT_DIR}/test/e2e/testresults --json-report=results.json --keep-separate-reports --race --nodes=1 ${GOTEST_VERBOSE} -r ${ROOT_DIR}/test/e2e/plugins_compatibility --trace > /tmp/out && { cat /tmp/out | grep -Ev 'STEP:|seconds|.go:'; rm /tmp/out; } || { exit_code=$$?; cat /tmp/out | grep -Ev 'STEP:|seconds|.go:'; rm /tmp/out; exit $$exit_code; } \

.PHONY: e2e-plugin-lifecycle-tests ## Execute CLI Core Plugin life cycle E2E test cases
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ the current CLI supports all older plugins and all plugins

We have created a github repository `https://github.com/chandrareddyp/tanzu-cli-test-plugins` to host
test plugins with different CLI Runtime versions which supported by current CLI Core, and
these test plugins are published manually to gcr.io/eminent-nation-87317/tanzu-cli/test/v1/plugins/plugin-inventory:latest
these test plugins are published manually to ghcr.io/vmware-tanzu/tanzu-cli/test/v1/plugins/plugin-inventory:latest
using publish tooling, these test plugins used during e2e plugin compatibility test execution.

## How and when E2E tests are executed
Expand Down
1 change: 1 addition & 0 deletions test/e2e/framework/framework_constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const (

// Central repository
TanzuCliE2ETestCentralRepositoryURL = "TANZU_CLI_E2E_TEST_CENTRAL_REPO_URL"
TanzuCliE2ETestCentralRepositoryPassword = "TANZU_CLI_E2E_TEST_CENTRAL_REPO_PASSWORD"
TanzuCliE2ETestLocalCentralRepositoryURL = "TANZU_CLI_E2E_TEST_LOCAL_CENTRAL_REPO_URL"
TanzuCliE2ETestLocalCentralRepositoryPluginDiscoveryImageSignaturePublicKeyPath = "TANZU_CLI_E2E_TEST_LOCAL_CENTRAL_REPO_PLUGIN_DISCOVERY_IMAGE_SIGNATURE_PUBLIC_KEY_PATH"
TanzuCliPluginDiscoveryImageSignaturePublicKeyPath = "TANZU_CLI_PLUGIN_DISCOVERY_IMAGE_SIGNATURE_PUBLIC_KEY_PATH"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@ var (
var _ = BeforeSuite(func() {
tf = framework.NewFramework()

// Login to airgapped repository
dockerloginCmd := fmt.Sprintf("docker login %s --username USERNAME --password %s", os.Getenv(framework.TanzuCliE2ETestCentralRepositoryURL), os.Getenv(framework.TanzuCliE2ETestCentralRepositoryPassword))
_, _, err := tf.Exec.Exec(dockerloginCmd)
Expect(err).To(BeNil())

// setup the test central repo
centralURI := os.Getenv(framework.TanzuCliE2ETestCentralRepositoryURL)
err := framework.UpdatePluginDiscoverySource(tf, centralURI)
err = framework.UpdatePluginDiscoverySource(tf, centralURI)
Expect(err).To(BeNil(), "should not get any error for plugin source update")

// get all plugins with name prefix "test-plugin-"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
// Each test plugin built using specific Tanzu CLI Runtime library versions.
// Here are sequence of test cases in below suite:
// a. Before installing test plugins, uninstall test plugins (if any installed already) and verify status using plugin list
// b. install all test plugins from repo gcr.io/eminent-nation-87317/tanzu-cli/test/v1/plugins/plugin-inventory:latest
// b. install all test plugins from repo ghcr.io/vmware-tanzu/tanzu-cli/test/v1/plugins/plugin-inventory:latest
// c. list all plugins and make sure all above installed test plugins are listed with status "installed"
// d. run basic commands on installed test plugins, to make sure works/co-exists with other plugins build with different runtime version
// e. run hello-world commands on installed test plugins, to make sure works/co-exists with other plugins build with different runtime version
Expand Down

0 comments on commit 659e0cd

Please sign in to comment.