Skip to content
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

fix(deps): update module sigs.k8s.io/e2e-framework to v0.2.0 - autoclosed #1145

Closed
wants to merge 1 commit into from

Conversation

cilium-renovate[bot]
Copy link
Contributor

@cilium-renovate cilium-renovate bot commented Jun 27, 2023

This PR contains the following updates:

Package Type Update Change
sigs.k8s.io/e2e-framework require minor v0.0.8 -> v0.2.0

⚠ Dependency Lookup Warnings ⚠

Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information.


Release Notes

kubernetes-sigs/e2e-framework (sigs.k8s.io/e2e-framework)

v0.2.0

Compare Source

This is the second release for 2023 after three months (and few days) of contribution from the community. This release packs a great deal of interesting features, fixes, and documentation updates. Let's highlight some of the below.

Properly filter tests with labels with same key values

This fix/feature, contributed by @​embano1, allows e2e-framework tests to parse labels with multiple values, that share the same key, properly. Prior to this fix, tests would not get filtered properly when different features happen to use the same key names. This fix makes it possible to have features with labels with same key names.

Support for Kubernetes cluster context

@​maruina contributed code that allows e2e-framework tests to specify the name of a cluster context using the --context flag. With this feature, your tests can now target a specific cluster context during execution.

Exporting kind logs during tests

@​alexandrevilain contributed a new feature that allows test authors to easily extract kind logs during tests. The feature is implemented as an envfunc function which means it can be used during any step of the life cycle of a running test. See this feature being used in this example.

Improved documentation

@​harshanarayana reorganized the documentation so that readers can easily find feature documentation for the project. You can reach the newly created doc section here.

@​maruina contributed documentation that shows how to setup e2e-framework tests using custom CLI flags. See the doc here

@​reetasingh created documentation that shows how to use the newly supported -skip when using go test. The doc highlights how to use the new flag along with other skip features already supported in the project. For detail see doc here.

Other notable updates

@​cpanato is doing an awesome job supporting the CI/CD pipeline for the project. His work has allowed dependabot to work smoothly allowing the project to keep up with the latest dependencies releases and fixes things when dependabot breaks them. Thanks @​cpanato!

@​pmalek create an alias for type env.TestFunc. Though a simple change, it will make it easier to repurpose environment functions in many parts of the code and authored tests.

What's Changed

Full changelog of everything that got changed:

New Contributors

Full Changelog: kubernetes-sigs/e2e-framework@v0.1.0...v0.2.0

v0.1.0

Compare Source

The e2e-framework continues to evolve with useful features for code writers looking for tooling to test their components running in Kubernetes. As with previous releases, members of the community contributed the lion share of this release.

Version number change

After nearly 2 years of being in development, this release will adopt the minor version number, starting with v0.1.0, to indicate the relative stability and continued adoption of the project.

Run commands inside pods

New in this release is the ability to programmatically launch commands that get executed inside a pod. This a useful feature that allows e2e-framework test writers to test code from within the pod itself. For instance, the following uses the ExecInPod method call to check connectivity from whithin a running pod.

func TestExecPod(t *testing.T) {
    deploymentName := "test-deployment"
    containerName := "curl"
    feature := features.New("Call external service").
        Assess("check connectivity to wikipedia.org main page", func(ctx context.Context, t *testing.T, c *envconf.Config) context.Context {
            client, _ := c.NewClient()
            pods := &corev1.PodList{}
            err = client.Resources(c.Namespace()).List(context.TODO(), pods)
            if err != nil || pods.Items == nil {
                t.Error("error while getting pods", err)
            }
            var stdout, stderr bytes.Buffer
            podName := pods.Items[0].Name
            command := []string{"curl", "-I", "https://en.wikipedia.org/wiki/Main_Page"}
            
            err := client.Resources().ExecInPod(c.Namespace(), podName, containerName, command, &stdout, &stderr)
            if err != nil {
                t.Log(stderr.String())
                t.Fatal(err)
            }
            
            httpStatus := strings.Split(stdout.String(), "\n")[0]
            if !strings.Contains(httpStatus, "200") {
                t.Fatal("Couldn't connect to en.wikipedia.org")
            }
            return ctx
        }).Feature()
    testEnv.Test(t, feature)
}

For further detail, see the example on ExecInPod.

Support for Kubernetes-SIGs/Kubetest2

Another feature introduced in this release is the support for running e2e-framework tests using the kubetest2. Assuming that your environment has the kubetest2 binary and KinD installed on the OS path, the following example will launch kind, run the e2e-framework tests found in the specified package directory, and shutdown kind when done.

kubetest2 kind --up --down           \
     --test=e2e-framework --         \
     --packages ./cluster            \
     --kubeconfig=$HOME/.kube/config \
     --skip-assessments=pod-count

For additional detail on kubetest2 support, see README in the third_party directory.

Access to Controller-Runtime client

When writing tests, sometimes you may want to have direct access to the controller-runtime client being used in the framework or use an existing client in your code. This release allows test writers to inject an existing client or access the client being used by e2e-framework.

func TestClient() {
func TestExecPod(t *testing.T) {
    feature := features.New("Client").
        Assess("access client", func(ctx context.Context, t *testing.T, c *envconf.Config) context.Context {
            e2eC, _ := c.NewClient()
            ctrlC := e2eC.GetControllerRuntimeClient()
            // use controller-runtime client directly
            ...
            return ctx
        }).Feature()
    ...
}

Other notable updates

  • @​harshanarayana added as project approver/maintainer for his many contributions
  • Setup of GitHub depabot for automatic updates of source dependencies
  • Minor documentation and code fix updates

Contributors

Special thanks to all who contributed:

@​harshanarayana
@​v0lkc
@​matrus2
@​mitchmckenzie
@​sozercan
@​jbpratt
@​cpanato

What's Changed

New Contributors

Full Changelog: kubernetes-sigs/e2e-framework@v0.0.8...v0.1.0


Configuration

📅 Schedule: Branch creation - "on monday and friday" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@cilium-renovate cilium-renovate bot requested a review from a team as a code owner June 27, 2023 09:47
@cilium-renovate cilium-renovate bot added kind/enhancement This improves or streamlines existing functionality release-blocker This PR or issue is blocking the next release. labels Jun 27, 2023
@cilium-renovate cilium-renovate bot force-pushed the renovate/sigs.k8s.io-e2e-framework-0.x branch 2 times, most recently from eaa533c to be7cc8e Compare June 27, 2023 17:41
Signed-off-by: cilium-renovate[bot] <134692979+cilium-renovate[bot]@users.noreply.github.com>
@cilium-renovate cilium-renovate bot force-pushed the renovate/sigs.k8s.io-e2e-framework-0.x branch from be7cc8e to ff04196 Compare June 28, 2023 18:21
@cilium-renovate cilium-renovate bot changed the title fix(deps): update module sigs.k8s.io/e2e-framework to v0.2.0 fix(deps): update module sigs.k8s.io/e2e-framework to v0.2.0 - autoclosed Jun 30, 2023
@cilium-renovate cilium-renovate bot closed this Jun 30, 2023
@cilium-renovate cilium-renovate bot deleted the renovate/sigs.k8s.io-e2e-framework-0.x branch June 30, 2023 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement This improves or streamlines existing functionality release-blocker This PR or issue is blocking the next release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants