Skip to content

OU-1472: run only changed tests - #1134

Open
PeterYurkovich wants to merge 1 commit into
move-viewsfrom
run-changes
Open

OU-1472: run only changed tests#1134
PeterYurkovich wants to merge 1 commit into
move-viewsfrom
run-changes

Conversation

@PeterYurkovich

Copy link
Copy Markdown
Contributor

Stack created with GitHub Stacks CLIGive Feedback 💬

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 12, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 12, 2026

Copy link
Copy Markdown

@PeterYurkovich: This pull request references OU-1472 which is a valid jira issue.

Details

In response to this:

Stack created with GitHub Stacks CLIGive Feedback 💬

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
openshift-ci Bot requested review from etmurasaki and jgbernalp August 12, 2026 19:40
@openshift-ci

openshift-ci Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: PeterYurkovich

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 12, 2026
@@ -0,0 +1,62 @@
#!/bin/bash

CHANGED_FILES=$(git diff --name-only origin/main...HEAD)

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.

The target branch might be different we should provide it from env defaulting to main

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.

we should add error handling, in shallow checkouts the main branch might not exist.

Comment thread web/package.json
"test-cypress-perses-dev": "node --max-old-space-size=4096 ./node_modules/.bin/cypress run --browser chrome --headless --env grepTags='@perses-dashboards --@xfail'",
"test-cypress-perses": "node --max-old-space-size=4096 ./node_modules/.bin/cypress run --browser chrome --headless --env grepTags='@perses-dashboards --@smoke --@flaky --@xfail'",
"test-cypress-perses-ivt": "node --max-old-space-size=4096 ./node_modules/.bin/cypress run --browser chrome --headless --env grepTags='@perses-dashboards --@smoke --@flaky --@xfail'",
"test-cypress-monitoring": "../scripts/run-selective-e2e.sh",

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.

Is this script in a different PR or should be ./cypress/run-changed.sh

if [ "$RUN_ALL" = true ]; then
echo "Changes affect global scope or unmapped features. Running ALL monitoring tests..."

DEFAULT_TAGS="@alerting @legacy-dashboards @metrics @targets acm-alerting @cluster-health-analyzer @perses-dashboards --@flaky --@xfail"

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.

Suggested change
DEFAULT_TAGS="@alerting @legacy-dashboards @metrics @targets acm-alerting @cluster-health-analyzer @perses-dashboards --@flaky --@xfail"
DEFAULT_TAGS="@alerting @legacy-dashboards @metrics @targets @acm-alerting @cluster-health-analyzer @perses-dashboards --@flaky --@xfail"

Comment thread web/package.json
"test": "npm run cypress:run:ci",
"test-cypress-console": "./node_modules/.bin/cypress open --browser chrome",
"test-cypress-console-headless": "node --max-old-space-size=4096 ./node_modules/.bin/cypress run --browser chrome --headless",
"test-cypress-monitoring": "node --max-old-space-size=4096 ./node_modules/.bin/cypress run --browser chrome --headless --env grepTags='@alerting+@legacy-dashboards+@metrics+@targets --@flaky --@xfail'",

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.

Do we need to update the cypress docs with these removals?

CHANGED_FILES=$(git diff --name-only origin/main...HEAD)

RUN_ALL=false
declare -A TAGS_TO_RUN

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.

We might need to change this into something POSIX compatible, I got the following issue while trying to run on mac:

./cypress/run-changed.sh: line 6: declare: -A: invalid option
declare: usage: declare [-afFirtx] [-p] [name[=value] ...]

done

if [ "$RUN_ALL" = true ]; then
echo "Changes affect global scope or unmapped features. Running ALL monitoring tests..."

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.

unmapped features already exits

Suggested change
echo "Changes affect global scope or unmapped features. Running ALL monitoring tests..."
echo "Changes affect global scope. Running ALL monitoring tests..."

FEATURE_MAP["perses-dashboards"]="@perses-dashboards"
FEATURE_MAP["targets"]="@targets"

for FILE in $CHANGED_FILES; do

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.

not sure if we have file paths with white spaces, but this will split on white space

@PeterYurkovich
PeterYurkovich force-pushed the run-changes branch 2 times, most recently from 2c3cc81 to 88ad602 Compare August 17, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants