Skip to content

Allow partial comparison of slices in asserts #76

@alembiewski

Description

@alembiewski

Edit 2025-02-03:

Note the recently added CEL support which should help with this issue


What would you like to be added:

It would be great to check only the subset of a slice in a test step assertion. Currently, it is required to specify all the array elements, otherwise, a test fails with slice length mismatch error.

Why is this needed:

Here are some real-life pain points:

  • if istio injection is enabled, a sidecar is running alongside with the main container in a pod, and it needs to be reflected in test assertions;
  • testing mutating webhook, which updates environment variables or volume/volume mounts for some container in a pod, and a test case checks the applied patch;
  • pod's status conditions (say, the goal of a test step is to check the only one, final condition);
  • and so on

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions