Skip to content

Conversation

@gianarb
Copy link

@gianarb gianarb commented Nov 10, 2025

Reference: #15002

Motivation

We want to increase the test coverage for our examples since they are important
to guide users and for documentations we want them to run correctly.

Modifications

Thi PR flips how we mark example with validation tests. Previously we were
marking only the examples with a test, it makes this process easy to kind of
chill out and avoid writing a validation test. We decided to run example tests
by default for all examples that do not explicitly exclude. This should help us
to writing those tests.

Verification

As part of exeuction of the tests I wrote the path of the examples that ran as
test in a file prev and after the change to validate that the same number of
examples got executed

Documentation

I could not find documentation mentioning the old label used so I didn't add
it. If you can point me to where I should add it I am happy to write something
about it.

@gianarb gianarb force-pushed the chore/new-example-testing-labeling branch 7 times, most recently from 639e09f to 87317dd Compare November 13, 2025 13:26
This commit removes the label `workflows.argoproj.io/test` used to mark
examples as testable because now we want as contributors to be more
explicit marking  examples that DO NOT have tests, this
should help maintainers to ask for those tests as part of code review.

This commit adds `workflows.argoproj.io/no-test-broken` for genuinely
broken examples which can be fixed or that do not have test yet.

`workflows.argoproj.io/no-test-environment` for examples which need to
run in a different environment, e.g. need access to artifactory but this
commit does not mark those.

Related argoproj#15002

Signed-off-by: Gianluca Arbezzano <[email protected]>
@gianarb gianarb force-pushed the chore/new-example-testing-labeling branch 17 times, most recently from 295a2ba to 9af4b12 Compare November 17, 2025 19:55
@gianarb gianarb marked this pull request as ready for review November 18, 2025 09:45
@Joibel Joibel requested a review from Copilot November 18, 2025 16:49
Copilot finished reviewing on behalf of Joibel November 18, 2025 16:51
Copy link
Contributor

Copilot AI left a comment

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 implements a strategy change for example test coverage by flipping from an opt-in to an opt-out approach. Instead of marking examples with workflows.argoproj.io/test: "true" to include them in testing, examples now run by default unless explicitly excluded with workflows.argoproj.io/no-test-broken or workflows.argoproj.io/no-test-environment labels. This change encourages better test coverage for documentation examples.

  • Inverted test filtering logic in test/e2e/examples_test.go to skip only labeled examples
  • Extended the allowed image list in test/e2e/fixtures/given.go to support more example scenarios
  • Updated approximately 100+ example YAML files to use the new labeling scheme and standardize container images

Reviewed Changes

Copilot reviewed 170 out of 175 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
test/e2e/examples_test.go Changed test logic from opt-in to opt-out filtering using new label names
test/e2e/fixtures/given.go Extended allowed images list for examples to include more common base images
test/e2e/testdata/cluster-workflow-template-ref.yaml Added no-test-broken label
examples/**/*.yaml (100+ files) Removed old test labels, added new exclusion labels, and standardized images to versions in allowlist
docs/fields.md Updated example references to reflect the new labeling scheme
.github/workflows/ci-build.yaml Added comment explaining example tests are non-retryable without controller restart

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

profile: minimal
use-api: false
retries: 0
# Example tests are not retryable withou a controller restart
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

Spelling error in comment: "withou" should be "without".

Copilot uses AI. Check for mistakes.
Comment on lines 43 to 44
image: busybox
command: [bash]
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

The image "debian:9.4" has been changed to "busybox", but the command remains [bash]. The busybox image typically uses sh instead of bash, which may cause this script to fail. Consider changing the command to [sh] or using an image that includes bash.

Copilot uses AI. Check for mistakes.
Comment on lines 35 to 37
image: busybox
command: [bash]
source: |
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

The image has been changed from "debian:9.4" to "busybox" with a trailing space. This trailing space in "busybox " may cause the container to fail to pull the image. Additionally, the command [bash] is incompatible with busybox, which typically uses sh. Consider removing the trailing space and changing the command to [sh].

Copilot uses AI. Check for mistakes.
path: /var/lib/influxdb/data
container:
image: debian:9.4
image: busybox
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

The image has been changed from "debian:9.4" to "busybox" with a trailing space. This trailing space in "busybox " may cause the container to fail to pull the image. Please remove the trailing space.

Copilot uses AI. Check for mistakes.
Comment on lines 33 to 34
image: busybox
command: [bash]
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

The image has been changed from "debian:9.4" to "busybox" with a trailing space. This trailing space in "busybox " may cause the container to fail to pull the image. Additionally, the command [bash] is incompatible with busybox, which typically uses sh. Consider removing the trailing space and changing the command to [sh].

Copilot uses AI. Check for mistakes.
- name: volumes-emptydir-example
container:
image: debian:latest
image: aline:3.6
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

Typo in image name: "aline:3.6" should be "alpine:3.6".

Copilot uses AI. Check for mistakes.
profile: minimal
use-api: false
retries: 0
# Example tests are not retryable withou a controller restart
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

Spelling error in comment: "exeuction" should be "execution".

Copilot uses AI. Check for mistakes.
@gianarb gianarb force-pushed the chore/new-example-testing-labeling branch 5 times, most recently from 236ed66 to 46cbf4f Compare November 24, 2025 11:49
…5002

Since we have changed how we identify if an example runs correctly as
test this commit applies to the new protocol in the test runner.

Signed-off-by: Gianluca Arbezzano <[email protected]>
@gianarb gianarb force-pushed the chore/new-example-testing-labeling branch 3 times, most recently from 2eeab30 to 6b35e1c Compare November 24, 2025 21:18
Copy link
Member

@Joibel Joibel left a comment

Choose a reason for hiding this comment

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

I think we need some more flags, and to really consider if any are broken. I've only reviewed down to http-success-condition, and will return to it later.

metadata:
generateName: timeouts-workflow-
labels:
workflows.argoproj.io/no-test-environment: "true"
Copy link
Member

@Joibel Joibel Nov 25, 2025

Choose a reason for hiding this comment

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

Another duration

kind: Workflow
metadata:
labels:
workflows.argoproj.io/no-test-broken: "true"
Copy link
Member

Choose a reason for hiding this comment

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

I presume this one "fails" but runs. It feels like maybe we need a separate label for no-test-expectedfailure or something?

Copy link
Author

Choose a reason for hiding this comment

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

yes makes sense to me. Should I proceed with that?

Copy link
Member

Choose a reason for hiding this comment

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

Yes please

Copy link
Member

Choose a reason for hiding this comment

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

This is mismatching on standard labels and misleading. Could you raise an issue to fix it please?

labels:
# Note that this label is required for the informer to detect this ConfigMap.
workflows.argoproj.io/configmap-type: Parameter
workflows.argoproj.io/no-test-environment: "true"
Copy link
Member

Choose a reason for hiding this comment

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

It would be cleaner if we only attempted files which contained kind: Workflow.

apiVersion: argoproj.io/v1alpha1
kind: WorkflowEventBinding
metadata:
labels:
Copy link
Member

Choose a reason for hiding this comment

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

Another untestable kind

metadata:
generateName: fibonacci-
labels:
workflows.argoproj.io/no-test-broken: "true"
Copy link
Member

Choose a reason for hiding this comment

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

Broken, or just takes too long?

Copy link
Author

Choose a reason for hiding this comment

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

This is the error I see at the moment:

 └ ✔ [2]              StepGroup 0s                                                                                                                                        20:45:19 [14/1953]
 └ ○ fibonacci-helper Skipped   0s      when '2 != 1 && 2 != 2' evaluated false
 └ ✔ fib-sub-1        Steps     0s
 └ ✔ [3]              StepGroup 0s
 └ ✖ add              Pod       3s      main: Error (exit code 1)
 └ ✖ [4]              StepGroup 5s      child 'fibonacci-cfsxr-3090884672' failed
 └ ✔ fib-sub-2        Steps     0s

    examples_test.go:75: condition never and cannot be met because the workflow is done

Logs from the failing pod:

time=2025-11-25T19:45:15.042Z level=INFO msg="capturing logs" argo=true
time=2025-11-25T19:45:15.042Z level=INFO msg="waiting for signals" argo=true signalPath=/var/run/argo/ctr/main/signal
  File "/argo/staging/script", line 1
    print(2 + {{steps.fib-sub-2.outputs.parameters.fib}})
                                      ^
SyntaxError: invalid syntax
time=2025-11-25T19:45:15.088Z level=DEBUG msg="ignore signal" argo=true signal="child exited"
time=2025-11-25T19:45:16.043Z level=INFO msg="file signal handler exiting due to context cancellation" argo=true
time=2025-11-25T19:45:16.043Z level=INFO msg="sub-process exited" argo=true error="exit status 1"
Error: exit status 1

kind: Workflow
metadata:
labels:
workflows.argoproj.io/no-test-broken: "true"
Copy link
Member

Choose a reason for hiding this comment

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

Not really broken, but untestable

kind: Workflow
metadata:
labels:
workflows.argoproj.io/no-test-broken: "true"
Copy link
Member

Choose a reason for hiding this comment

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

environment surely, as no HDFS?

metadata:
generateName: hello-world-
labels:
workflows.argoproj.io/no-test-broken: "true"
Copy link
Member

Choose a reason for hiding this comment

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

Really need this one to be working, so tested, what's wrong with it?

metadata:
generateName: http-template-condition-
labels:
workflows.argoproj.io/no-test-broken: "true"
Copy link
Member

Choose a reason for hiding this comment

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

Another can we fix it one?

Copy link
Author

Choose a reason for hiding this comment

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

fixed the url used to retrieve status code did not work anymore



This commits adds two new labels to communicate why an example can't run
as part of the validation test suite:

1. `duration` when an example is expected to run for more than the
   expected test timeout.
2. `expected-failure` when an example is expected to fail.

Signed-off-by: Gianluca Arbezzano <[email protected]>
@gianarb gianarb force-pushed the chore/new-example-testing-labeling branch 2 times, most recently from 50f93bd to 74e63ed Compare November 25, 2025 20:08
Copy link
Member

@Joibel Joibel left a comment

Choose a reason for hiding this comment

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

Can we make sure that only tests that are really properly broken are marked as broken, because we should fix those. If they're otherwise untestable they should get a different flag.

metadata:
generateName: workflow-template-dag-diamond-
labels:
workflows.argoproj.io/no-test-broken: "true"
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure how you'd intend to implement this, but could we just do two passes of all the yaml?

First pass installs anything it finds that's not a workflow (e.g. the WFT and ClusterWFTs, ConfigMap) and then second pass is the test. This means its easy to extend, and doesn't need anything hard coded. Failure to install the other types would be a worthwhile check as well, and any that we can't install could be labelled with no-test also

kind: Workflow
metadata:
labels:
workflows.argoproj.io/no-test-broken: "true"
Copy link
Member

Choose a reason for hiding this comment

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

Ok, the second half is designed to fail, so this one should be an expected failure

kind: Workflow
metadata:
labels:
workflows.argoproj.io/no-test-broken: "true"
Copy link
Member

Choose a reason for hiding this comment

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

This one should work, why is it broken?

kind: Workflow
metadata:
labels:
workflows.argoproj.io/no-test-environment: "true"
Copy link
Member

Choose a reason for hiding this comment

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

This should be updated to something that works

kind: Workflow
metadata:
labels:
workflows.argoproj.io/no-test-broken: "true"
Copy link
Member

Choose a reason for hiding this comment

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

This is one that needs interaction, so not broken, needs a different label

metadata:
generateName: sidecar-dind-
labels:
workflows.argoproj.io/no-test-broken: "true"
Copy link
Member

Choose a reason for hiding this comment

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

Environment surely

metadata:
generateName: secrets-
labels:
workflows.argoproj.io/no-test-broken: "true"
Copy link
Member

Choose a reason for hiding this comment

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

environment?

metadata:
generateName: retry-on-error-
labels:
workflows.argoproj.io/no-test-environment: "true"
Copy link
Member

Choose a reason for hiding this comment

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

untestable I suspect due to randomness

metadata:
generateName: parallelism-template-limit-
labels:
workflows.argoproj.io/no-test-broken: "true"
Copy link
Member

Choose a reason for hiding this comment

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

Duration?

generateName: output-parameter-
labels:
workflows.argoproj.io/no-test-broken: "true"
spec:
Copy link
Member

Choose a reason for hiding this comment

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

Really needs to work

@gianarb gianarb force-pushed the chore/new-example-testing-labeling branch from 74e63ed to 4deedf7 Compare November 27, 2025 22:24
Many examples could pass tests but they were marked as no-test for
various reasons.

I analyzed all the tests and I marked the one that did not pass as
`no-test-broken` or `-no-test-environment` according to why they were
not passing.

The most common issues for failing example were the image used as part
of the workflow since we have a list of allowed images that can run as
tests I expanded the list accordingly and I moved some images that were
doing easy tasks for already allowed images.

For example we had some debian images that were running `sleep` or
`cat`, such commands can run from a busybox and it was already allowed
so I moved the workflow to use it.

As follow up I will update images to their up to date version.

Signed-off-by: Gianluca Arbezzano <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants