Skip to content

Commit

Permalink
🐛 Fix connectivity check order of the args, pin core version to 1.4.6 (
Browse files Browse the repository at this point in the history
…#123)

* Add default go.work.example file to enable linting in e2e

Signed-off-by: Danil Grigorev <danil.grigorev@suse.com>

* Fix connectivity check order of the args, pin core version to 1.4.6

- Use capi core version 1.4.6 in e2e

Co-authored-by: Richard Case <198425+richardcase@users.noreply.github.com>
Signed-off-by: Danil Grigorev <danil.grigorev@suse.com>

---------

Signed-off-by: Danil Grigorev <danil.grigorev@suse.com>
Co-authored-by: Richard Case <198425+richardcase@users.noreply.github.com>
  • Loading branch information
Danil-Grigorev and richardcase authored Sep 19, 2023
1 parent 46fbb6a commit 36b2e77
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 3 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,17 @@ What happens when you run `make dev-env`?
4. `Rancher manager` is installed using helm.
5. Run `tilt up` to start the development environment.

# Testing

We are using a combination of unit tests and e2e tests both using ginkgo and gomega frameworks.

To run unit tests, execute:
```sh
make test
```

Detailed documentation on e2e tests architecture and usage could be found [here](./test/e2e/README.md#e2e-tests).

## Code of Conduct

Participation in the project is governed by [Code of Conduct](code-of-conduct.md).
6 changes: 6 additions & 0 deletions go.work.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
go 1.21

use (
./rancher-turtles
./rancher-turtles/test
)
2 changes: 2 additions & 0 deletions test/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export RANCHER_HOSTNAME=<YOUR_DOMAIN_NAME>

Now you are ready to start your e2e test run.

Additionally, you could reuse [`go.work.example`](../../go.work.example) and copy it into `rancher-turtles/../go.work` to allow linting in tests. Be aware that this may break vendoring process used for `make test` task due to incompatibility between the two. You will need to add `e2e` to build tags in your IDE of choice for the imports in the test suite to become resolvable.

### Running the tests

From the project root directory:
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/config/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ variables:
RANCHER_FEATURES: "embedded-cluster-api=false"
RANCHER_PATH: "rancher-stable/rancher"
KUBERNETES_VERSION: "v1.26.3"
CAPI_INFRASTRUCTURE: "docker"
CAPI_INFRASTRUCTURE: "docker:v1.4.6"
CAPI_CORE: "cluster-api:v1.4.6"
RANCHER_REPO_NAME: "rancher-stable"
RANCHER_URL: "https://releases.rancher.com/server-charts/stable"
RANCHER_PASSWORD: "rancheradmin"
Expand Down
6 changes: 5 additions & 1 deletion test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const (
rancherRepoName = "RANCHER_REPO_NAME"
rancherPassword = "RANCHER_PASSWORD"
capiInfrastructure = "CAPI_INFRASTRUCTURE"
capiCore = "CAPI_CORE"

ngrokRepoName = "NGROK_REPO_NAME"
ngrokUrl = "NGROK_URL"
Expand Down Expand Up @@ -255,7 +256,10 @@ func initRancherTurtles(clusterProxy framework.ClusterProxy, config *clusterctl.
Path: chartPath,
Name: "rancher-turtles",
Kubeconfig: clusterProxy.GetKubeconfigPath(),
AdditionalFlags: Flags("-n", rancherTurtlesNamespace, "--create-namespace", "--wait"),
AdditionalFlags: Flags(
"--dependency-update",
"-n", rancherTurtlesNamespace,
"--create-namespace", "--wait"),
}
_, err := chart.Run(map[string]string{
"cluster-api-operator.cluster-api.configSecret.namespace": "default",
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ var _ = Describe("Create and delete CAPI cluster functionality should work", fun
By("Waiting for the CAPI cluster to be connectable")
Eventually(func() error {
namespaces := &corev1.NamespaceList{}
remoteClient := bootstrapClusterProxy.GetWorkloadCluster(ctx, capiCluster.Name, capiCluster.Namespace).GetClient()
remoteClient := bootstrapClusterProxy.GetWorkloadCluster(ctx, capiCluster.Namespace, capiCluster.Name).GetClient()
return remoteClient.List(ctx, namespaces)
}, e2eConfig.GetIntervals(bootstrapClusterProxy.GetName(), "wait-rancher")...).Should(Succeed())

Expand Down

0 comments on commit 36b2e77

Please sign in to comment.