Skip to content

Fix e2e function tests - #1123

Merged
efiacor merged 2 commits into
kptdev:mainfrom
Nordix:fix-e2e-fn-tests
Jul 21, 2026
Merged

Fix e2e function tests#1123
efiacor merged 2 commits into
kptdev:mainfrom
Nordix:fix-e2e-fn-tests

Conversation

@liamfallon

@liamfallon liamfallon commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Fix e2e function tests

Description

  • What changed: The e2e function tests are now working (apart from the ensure-name-substring tests because the ensure-name-substring krm function is broken
  • Why it’s needed: The tests failed due to incorrect paths to test data and old versions of KRM functions being hardcoded
  • How it works:
  • The hardcoded versions of krm functions are moved to the test/e2e/fn_runner/testdata/function-versions.yaml file
  • Support for readiung test/e2e/fn_runner/testdata/function-versions.yaml is added to test/e2e/fn_runner/3rd_party_kpt_fn_test.go
  • The hardcoded funciton versions are now removed and the versions are added from function-versions.yaml
  • The 3rd_party_kpt_fn_test.go file now builds the test cases from the configuration fil.

The function-versions.yaml file has the following structure

versions:
  the-krm-function:
    latest: v0.3.0  # Mandatory: Should be the most up to date released and supported version
    minus1: v0.2.5  # Mandatory: Should be the n-1 (latest but one) released and supported version
    other: v0.1.4   # Optional: Another release that should be tested
    skip: false     # Whether tests for this function should be skipped, defaults to false, useful if its known a function is temporarily broken

Tests of the bare krm function and the latest version of the KRM function are always added and tests are performed with and without the image prefix. Tests for the latest released minor default version and major default version are also generated. The configuration above will trigger tests on the following images:

ghcr.io/kptdev/krm-functions-catalog/the-krm-function
ghcr.io/kptdev/krm-functions-catalog/the-krm-function:latest
ghcr.io/kptdev/krm-functions-catalog/the-krm-function:v0.3.0
ghcr.io/kptdev/krm-functions-catalog/the-krm-function:v0.3
ghcr.io/kptdev/krm-functions-catalog/the-krm-function:v0
ghcr.io/kptdev/krm-functions-catalog/the-krm-function:v0.2.5
ghcr.io/kptdev/krm-functions-catalog/the-krm-function:v0.1.4
the-krm-function
the-krm-function:latest
the-krm-function:v0.3.0
the-krm-function:v0.3
the-krm-function:v0
the-krm-function:v0.2.5
the-krm-function:v0.1.4

Type of Change

  • Bug fix
  • New feature
  • Enhancement
  • Refactor
  • Documentation
  • Tests
  • Other: ________

Checklist

  • Code follows project style guidelines
  • Self-reviewed changes
  • Tests added/updated
  • Documentation added/updated
  • All tests and gating checks pass

AI Disclosure

  • I have used AI in the creation of this PR.

Signed-off-by: liamfallon <liam.fallon@est.tech>
@liamfallon
liamfallon requested review from a team July 20, 2026 14:38
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 20, 2026
@netlify

netlify Bot commented Jul 20, 2026

Copy link
Copy Markdown

Deploy Preview for kpt-porch ready!

Name Link
🔨 Latest commit 62975d5
🔍 Latest deploy log https://app.netlify.com/projects/kpt-porch/deploys/6a5f21541997010008a3d380
😎 Deploy Preview https://deploy-preview-1123--kpt-porch.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the e2e “3rd party kpt function” test suite to stop hardcoding KRM function image versions and testdata paths, instead generating test cases from a YAML configuration file so the suite is easier to keep up to date (including temporarily skipping known-broken functions).

Changes:

  • Add test/e2e/fn_runner/testdata/function-versions.yaml to centrally define which function versions to test (latest, n-1, optional other, and skip).
  • Update test/e2e/fn_runner/3rd_party_kpt_fn_test.go to load versions from that YAML and generate image test cases (absolute/relative, tagged, minor/major tags).
  • Fix multiple testdata resource paths used by the suite.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
test/e2e/fn_runner/testdata/function-versions.yaml New YAML config defining per-function versions to test and skip flags.
test/e2e/fn_runner/3rd_party_kpt_fn_test.go Refactors tests to build cases from YAML config and updates testdata file paths accordingly.

Comment thread test/e2e/fn_runner/3rd_party_kpt_fn_test.go Outdated
Comment thread test/e2e/fn_runner/3rd_party_kpt_fn_test.go Outdated
Comment thread test/e2e/fn_runner/3rd_party_kpt_fn_test.go
Comment thread test/e2e/fn_runner/3rd_party_kpt_fn_test.go
Comment thread test/e2e/fn_runner/3rd_party_kpt_fn_test.go
Comment thread test/e2e/fn_runner/testdata/function-versions.yaml Outdated
Signed-off-by: liamfallon <liam.fallon@est.tech>
@sonarqubecloud

Copy link
Copy Markdown

@dosubot dosubot Bot added the lgtm #ededed label Jul 21, 2026
@efiacor
efiacor merged commit cfe8a9c into kptdev:main Jul 21, 2026
30 of 32 checks passed
@efiacor
efiacor deleted the fix-e2e-fn-tests branch July 21, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm #ededed size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants