-
Notifications
You must be signed in to change notification settings - Fork 231
USHIFT-6337: Align release CI tests with brew RPM source commit #7089
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,193 @@ | ||||||||||||||||
| #!/bin/bash | ||||||||||||||||
| # | ||||||||||||||||
| # Aligns test code (test/suites/, test/resources/) with the brew RPM | ||||||||||||||||
| # source commit so that release CI jobs do not run HEAD tests against | ||||||||||||||||
| # older brew-built binaries. | ||||||||||||||||
| # | ||||||||||||||||
| # Must be sourced, not executed directly. | ||||||||||||||||
|
|
||||||||||||||||
| if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then | ||||||||||||||||
| echo "This script must be sourced, not executed." | ||||||||||||||||
| exit 1 | ||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| MAX_BREW_SKEW="${MAX_BREW_SKEW:-100}" | ||||||||||||||||
|
|
||||||||||||||||
| BREW_SOURCE_COMMIT="${BREW_SOURCE_COMMIT:-}" | ||||||||||||||||
| BREW_SOURCE_SHORTCOMMIT="${BREW_SOURCE_SHORTCOMMIT:-}" | ||||||||||||||||
| BREW_TEST_ALIGNED="${BREW_TEST_ALIGNED:-false}" | ||||||||||||||||
| BREW_COMMIT_DELTA="${BREW_COMMIT_DELTA:-0}" | ||||||||||||||||
|
|
||||||||||||||||
| # Extract the source commit SHA from the brew LREL RPM's release field. | ||||||||||||||||
| # The NVR release field format is: | ||||||||||||||||
| # YYYYMMDDHHMMSS.p0.g<shortcommit>.assembly.<stream>.el<N> | ||||||||||||||||
| # Sets BREW_SOURCE_COMMIT (full SHA) and BREW_SOURCE_SHORTCOMMIT. | ||||||||||||||||
| get_brew_source_commit() { | ||||||||||||||||
| local -r vrel="${BREW_LREL_RELEASE_VERSION:-}" | ||||||||||||||||
| if [[ -z "${vrel}" ]]; then | ||||||||||||||||
| return 0 | ||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| local -r release_field="${vrel#*-}" | ||||||||||||||||
|
|
||||||||||||||||
| local shortcommit="" | ||||||||||||||||
| if [[ "${release_field}" =~ \.g([0-9a-f]{7,})\. ]]; then | ||||||||||||||||
| shortcommit="${BASH_REMATCH[1]}" | ||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| if [[ -z "${shortcommit}" ]]; then | ||||||||||||||||
| echo "ERROR: Cannot parse git shortcommit from brew release field: ${release_field}" | ||||||||||||||||
| return 1 | ||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| BREW_SOURCE_SHORTCOMMIT="${shortcommit}" | ||||||||||||||||
| export BREW_SOURCE_SHORTCOMMIT | ||||||||||||||||
|
|
||||||||||||||||
| local full_sha="" | ||||||||||||||||
| if full_sha=$(git rev-parse "${shortcommit}^{commit}" 2>/dev/null); then | ||||||||||||||||
| BREW_SOURCE_COMMIT="${full_sha}" | ||||||||||||||||
| else | ||||||||||||||||
| BREW_SOURCE_COMMIT="${shortcommit}" | ||||||||||||||||
| fi | ||||||||||||||||
| export BREW_SOURCE_COMMIT | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| # Fetch the brew source commit if it is not available in the local | ||||||||||||||||
| # git history. CI environments may use shallow clones. | ||||||||||||||||
| fetch_brew_commit_if_needed() { | ||||||||||||||||
| local -r commit="$1" | ||||||||||||||||
|
|
||||||||||||||||
| if git cat-file -e "${commit}^{commit}" 2>/dev/null; then | ||||||||||||||||
| return 0 | ||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| echo "Brew source commit ${commit} not found locally, fetching..." | ||||||||||||||||
|
|
||||||||||||||||
| if git fetch origin "${commit}" 2>/dev/null; then | ||||||||||||||||
| if git cat-file -e "${commit}^{commit}" 2>/dev/null; then | ||||||||||||||||
| return 0 | ||||||||||||||||
| fi | ||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| if git rev-parse --is-shallow-repository 2>/dev/null | grep -q true; then | ||||||||||||||||
| echo "Shallow repository detected, unshallowing..." | ||||||||||||||||
| if git fetch --unshallow origin 2>/dev/null; then | ||||||||||||||||
| if git cat-file -e "${commit}^{commit}" 2>/dev/null; then | ||||||||||||||||
| return 0 | ||||||||||||||||
| fi | ||||||||||||||||
| fi | ||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| echo "ERROR: Cannot fetch brew source commit ${commit}" | ||||||||||||||||
| return 1 | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| # Check out test/suites/ and test/resources/ at the brew source commit. | ||||||||||||||||
| # Uses git checkout <sha> -- <paths>, which modifies the working tree | ||||||||||||||||
| # without changing HEAD. | ||||||||||||||||
| # | ||||||||||||||||
| # Globals read: | ||||||||||||||||
| # BREW_SOURCE_COMMIT - full SHA from get_brew_source_commit() | ||||||||||||||||
| # ROOTDIR - repository root (from common.sh) | ||||||||||||||||
| # MAX_BREW_SKEW - maximum allowed commit delta | ||||||||||||||||
| # | ||||||||||||||||
| # Globals set: | ||||||||||||||||
| # BREW_TEST_ALIGNED - "true" if checkout was performed | ||||||||||||||||
| # BREW_COMMIT_DELTA - integer commit count between brew SHA and HEAD | ||||||||||||||||
| checkout_brew_aligned_tests() { | ||||||||||||||||
| BREW_TEST_ALIGNED="false" | ||||||||||||||||
| BREW_COMMIT_DELTA=0 | ||||||||||||||||
|
|
||||||||||||||||
| local -r brew_sha="${BREW_SOURCE_COMMIT:-}" | ||||||||||||||||
| if [[ -z "${brew_sha}" ]]; then | ||||||||||||||||
| echo "BREW_SOURCE_COMMIT is not set, skipping test alignment" | ||||||||||||||||
| return 0 | ||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| local -r head_sha="$(git -C "${ROOTDIR}" rev-parse HEAD)" | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π©Ί Stability & Availability | π‘ Minor | β‘ Quick win Declare/assign separately to avoid masking
As per coding guidelines, "Shell scripts must pass π©Ή Proposed fix- local -r head_sha="$(git -C "${ROOTDIR}" rev-parse HEAD)"
+ local head_sha
+ if ! head_sha="$(git -C "${ROOTDIR}" rev-parse HEAD)"; then
+ echo "ERROR: Cannot resolve HEAD commit"
+ return 1
+ fi
+ readonly head_shaπ Committable suggestion
Suggested change
π€ Prompt for AI AgentsSource: Coding guidelines |
||||||||||||||||
| if [[ "${brew_sha}" == "${head_sha}" ]]; then | ||||||||||||||||
| echo "Brew source commit matches HEAD, no alignment needed" | ||||||||||||||||
| BREW_TEST_ALIGNED="true" | ||||||||||||||||
| BREW_COMMIT_DELTA=0 | ||||||||||||||||
| export BREW_TEST_ALIGNED BREW_COMMIT_DELTA | ||||||||||||||||
| return 0 | ||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| if ! fetch_brew_commit_if_needed "${brew_sha}"; then | ||||||||||||||||
| echo "ERROR: Cannot proceed with test alignment" | ||||||||||||||||
| return 1 | ||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| local delta | ||||||||||||||||
| if delta=$(git -C "${ROOTDIR}" rev-list --count "${brew_sha}..${head_sha}" 2>/dev/null); then | ||||||||||||||||
| BREW_COMMIT_DELTA="${delta}" | ||||||||||||||||
| else | ||||||||||||||||
| echo "WARNING: Cannot compute commit delta (commits not on same lineage)" | ||||||||||||||||
| BREW_COMMIT_DELTA=-1 | ||||||||||||||||
| fi | ||||||||||||||||
| export BREW_COMMIT_DELTA | ||||||||||||||||
|
|
||||||||||||||||
| echo "Brew source commit: ${brew_sha}" | ||||||||||||||||
| echo "HEAD commit: ${head_sha}" | ||||||||||||||||
| echo "Commit delta: ${BREW_COMMIT_DELTA}" | ||||||||||||||||
|
|
||||||||||||||||
| if [[ "${BREW_COMMIT_DELTA}" -ne -1 ]] && [[ "${BREW_COMMIT_DELTA}" -gt "${MAX_BREW_SKEW}" ]]; then | ||||||||||||||||
| echo "ERROR: Commit delta ${BREW_COMMIT_DELTA} exceeds MAX_BREW_SKEW=${MAX_BREW_SKEW}" | ||||||||||||||||
| return 1 | ||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| echo "Checking out test/suites/ and test/resources/ at brew commit ${brew_sha}" | ||||||||||||||||
| if ! git -C "${ROOTDIR}" checkout "${brew_sha}" -- test/suites/ test/resources/ 2>&1; then | ||||||||||||||||
| echo "ERROR: Failed to checkout test directories at ${brew_sha}" | ||||||||||||||||
| return 1 | ||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| BREW_TEST_ALIGNED="true" | ||||||||||||||||
| export BREW_TEST_ALIGNED | ||||||||||||||||
|
|
||||||||||||||||
| echo "Test code aligned to brew source commit ${brew_sha}" | ||||||||||||||||
| return 0 | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| # Restore test directories to HEAD after tests complete. | ||||||||||||||||
| restore_head_tests() { | ||||||||||||||||
| if [[ "${BREW_TEST_ALIGNED:-false}" == "true" ]]; then | ||||||||||||||||
| echo "Restoring test/suites/ and test/resources/ to HEAD" | ||||||||||||||||
| git -C "${ROOTDIR}" checkout HEAD -- test/suites/ test/resources/ 2>/dev/null || true | ||||||||||||||||
| fi | ||||||||||||||||
| } | ||||||||||||||||
|
Comment on lines
+97
to
+158
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π― Functional Correctness | π΄ Critical | ποΈ Heavy lift π§© Analysis chainπ Script executed: #!/usr/bin/bash
set -euo pipefail
echo "Files:"
git ls-files | rg '(^|/)brew_test_alignment\.sh$|(^|/)test/(suites|resources)/' | head -80
echo
echo "Target section:"
if [ -f test/bin/brew_test_alignment.sh ]; then
nl -ba test/bin/brew_test_alignment.sh | sed -n '1,190p'
fi
echo
echo "Search tests for BREW_TEST_ALIGNED / BREW_COMMIT_DELTA:"
rg -n "BREW_TEST_ALIGNED|BREW_COMMIT_DELTA|MAX_BREW_SKEW|checkout_brew_aligned_tests|restore_head_tests|BREW_SOURCE_COMMIT" .Repository: openshift/microshift Length of output: 3369 π Web query:
π‘ Result: In Git, "overlay mode" is a behavior where the command being executed does not remove files from the index or the working tree if they are absent in the source (e.g., the commit or tree-ish being checked out) [1][2]. Specifically regarding git checkout: - When using git checkout to restore paths, it operates in a default overlay mode [1][3]. - In this overlay mode, git checkout will update existing files in the index and working tree to match the specified source, but it will never remove files that are already present in your index or working tree if those files do not exist in the source [1][4]. - While the git checkout documentation mentions --overlay and --no-overlay flags, these are primarily discussed in the context of their implementation or related commands; historically, git checkout has maintained this non-destructive "overlay" behavior as its default [1][2]. This behavior contrasts with the newer command, git restore, which was introduced to separate and clarify the complex responsibilities of git checkout [5]. By default, git restore operates in "no-overlay" mode, meaning it will remove tracked files from the working tree or index if they do not exist in the source [6][7]. Users can pass the --overlay flag to git restore to mimic the traditional, non-destructive behavior of git checkout [8][6]. Citations:
π Script executed: #!/usr/bin/bash
set -euo pipefail
echo "Target section:"
if command -v nl >/dev/null; then
nl -ba test/bin/brew_test_alignment.sh | sed -n '1,190p'
else
cat -n test/bin/brew_test_alignment.sh | sed -n '1,190p'
fi
echo
echo "Search tests for BREW_TEST_ALIGNED / BREW_COMMIT_DELTA:"
rg -n "BREW_TEST_ALIGNED|BREW_COMMIT_DELTA|MAX_BREW_SKEW|checkout_brew_aligned_tests|restore_head_tests|BREW_SOURCE_COMMIT" . || true
echo
echo "Behavior probe for checkout-path semantics:"
cd /tmp
rm -rf repo-shape-probe
mkdir repo-shape-probe
cd repo-shape-probe
export GIT_AUTHOR_NAME="Test" GIT_AUTHOR_EMAIL="test@test.test" GIT_COMMITTER_NAME="Test" GIT_COMMITTER_EMAIL="test@test.test"
git init -q
echo "old" > test/suites/x.robot
git add test/suites/x.robot
git commit -q -m "base"
OLD="$(git rev-parse HEAD)"
mkdir -p newdir
echo "extra" > test/suites/newdir/y.robot
echo "old" > test/suites/x.robot
echo "old" > test/resources/z.res
git add test/suites/newdir/y.robot test/suites/x.robot test/resources/z.res
git rm -q test/suites/x.robot
git commit -q -m "late"
HEAD="$(git rev-parse HEAD)"
echo "Before OLD checkout:"
find test -type f | sort
git -C "$PWD" checkout "$OLD" -- test/suites/ test/resources/ 2>&1 || true
echo "After OLD checkout:"
find test -type f | sort
git -C "$PWD" status --short
echo
git -C "$PWD" checkout "$HEAD" -- test/suites/ test/resources/ 2>&1 || true
echo "After restore HEAD checkout:"
find test -type f | sort
git -C "$PWD" status --shortRepository: openshift/microshift Length of output: 11234 π Script executed: #!/usr/bin/bash
set -euo pipefail
echo "Behavior probe in temp repo:"
cd /tmp
rm -rf repo-shape-probe
mkdir -p repo-shape-probe
pushd repo-shape-probe >/dev/null
export GIT_AUTHOR_NAME="Test" GIT_AUTHOR_EMAIL="test@test.test" \
GIT_COMMITTER_NAME="Test" GIT_COMMITTER_EMAIL="test@test.test"
git init -q
mkdir -p test/suites test/resources
printf 'old\n' > test/suites/x.robot
git add test/suites/x.robot
git commit -q -m 'base'
OLD="$(git rev-parse HEAD)"
mkdir -p test/suites/newdir
printf 'extra\n' > test/suites/newdir/y.robot
printf 'old\n' > test/suites/x.robot
printf 'old\n' > test/resources/z.res
git add test/suites/newdir/y.robot test/suites/x.robot test/resources/z.res
git rm -q test/suites/x.robot
git commit -q -m 'late'
HEAD="$(git rev-parse HEAD)"
echo '--- before checkout ---'
find test -type f | sort
printf '--- checkout OLD ---\n'
git checkout "$OLD" -- test/suites/ test/resources/
echo '--- after checkout ---'
find test -type f | sort
git status --short
printf '--- checkout HEAD ---\n'
git checkout "$HEAD" -- test/suites/ test/resources/
echo '--- after restore ---'
find test -type f | sort
git status --short
popd >/dev/nullRepository: openshift/microshift Length of output: 351 π Web query:
π‘ Result: The git checkout command does not support the --diff-filter option [1][2][3]. The --diff-filter option is a feature of git diff and other similar commands used for comparing revisions, but it is not available in git checkout [4][5]. To achieve the desired resultβsuch as checking out files that have been deleted or modified in another branchβyou must first use git diff to identify the files and then pass those file paths to git checkout [6][7]. A common and recommended approach is to use xargs to pipe the output of git diff into git checkout: git diff --diff-filter=A --name-only -z | xargs -0 git checkout -- In this command: 1. git diff --diff-filter=A --name-only -z identifies files that have been added (or otherwise match the filter) in the specified commit or branch and lists them as null-terminated strings (-z) [4][5][7]. 2. xargs -0 processes these null-terminated file names and passes them as arguments to the git checkout command [7]. 3. git checkout -- restores the specified files from the source branch to your current working directory [1][6]. Using the -z and -0 flags is best practice to correctly handle file names that contain spaces or special characters [7]. Citations:
π Script executed: #!/usr/bin/bash
set -euo pipefail
echo "Behavior probe in temp repo:"
cd /tmp
rm -rf repo-shape-probe
mkdir -p repo-shape-probe
pushd repo-shape-probe >/dev/null
export GIT_AUTHOR_NAME="Test" GIT_AUTHOR_EMAIL="test@test.test" \
GIT_COMMITTER_NAME="Test" GIT_COMMITTER_EMAIL="test@test.test"
git init -q
mkdir -p test/suites test/resources
printf '%s\n' old > test/suites/x.robot
git add test/suites/x.robot
git commit -q -m 'base'
OLD="$(git rev-parse HEAD)"
mkdir -p test/suites/newdir
printf '%s\n' extra > test/suites/newdir/y.robot
printf '%s\n' old > test/suites/x.robot
printf '%s\n' old > test/resources/z.res
git add test/suites/newdir/y.robot test/suites/x.robot test/resources/z.res
git rm -q test/suites/x.robot
git commit -q -m 'late'
HEAD="$(git rev-parse HEAD)"
printf '%s\n' '--- before checkout ---'
find test -type f | sort
printf '%s\n' '--- checkout OLD ---'
git checkout "$OLD" -- test/suites/ test/resources/
printf '%s\n' '--- after checkout ---'
find test -type f | sort
git status --short
printf '%s\n' '--- checkout HEAD ---'
git checkout "$HEAD" -- test/suites/ test/resources/
printf '%s\n' '--- after restore ---'
find test -type f | sort
git status --short
printf '%s\n' '--- diff added/deleted between ---'
git diff --name-status --diff-filter=AD "$OLD"..."$HEAD" -- test/suites/ test/resources/
popd >/dev/nullRepository: openshift/microshift Length of output: 353 π Script executed: #!/usr/bin/bash
set -euo pipefail
echo "Behavior probe in temp repo:"
cd /tmp
rm -rf repo-shape-probe
mkdir -p repo-shape-probe
pushd repo-shape-probe >/dev/null
export GIT_AUTHOR_NAME="Test" GIT_AUTHOR_EMAIL="test@test.test" \
GIT_COMMITTER_NAME="Test" GIT_COMMITTER_EMAIL="test@test.test"
git init -q
mkdir -p test/suites test/resources
printf '%s\n' old > test/suites/x.robot
printf '%s\n' base > test/resources/a.res
git add test
git commit -q -m 'base'
OLD="$(git rev-parse HEAD)"
mkdir -p test/suites/newdir
printf '%s\n' extra > test/suites/newdir/y.robot
printf '%s\n' old > test/suites/x.robot
printf '%s\n' removed > test/resources/removed.res
git add test/suites/newdir/y.robot test/suites/x.robot test/resources/removed.res
git rm -q test/suites/x.robot test/resources/removed.res
git commit -q -m 'late'
HEAD="$(git rev-parse HEAD)"
printf '%s\n' '--- before checkout ---'
find test -type f | sort
printf '%s\n' '--- checkout OLD ---'
git checkout "$OLD" -- test/suites test/resources
printf '%s\n' '--- after checkout ---'
find test -type f | sort
git status --short
printf '%s\n' '--- checkout HEAD ---'
git checkout "$HEAD" -- test/suites test/resources
printf '%s\n' '--- after restore ---'
find test -type f | sort
git status --short
printf '%s\n' '--- diff added/deleted between ---'
git diff --name-status --diff-filter=AD "$OLD"..."$HEAD" -- test/suites test/resources
popd >/dev/nullRepository: openshift/microshift Length of output: 333 Align and restore by reconciling added and deleted paths.
π€ Prompt for AI Agents |
||||||||||||||||
|
|
||||||||||||||||
| # Write a JSON sidecar artifact with brew alignment metadata. | ||||||||||||||||
| # Each scenario invocation writes its own copy for per-scenario audit. | ||||||||||||||||
| emit_brew_alignment_artifact() { | ||||||||||||||||
| local -r artifact_dir="${SCENARIO_INFO_DIR}/${SCENARIO}" | ||||||||||||||||
| mkdir -p "${artifact_dir}" | ||||||||||||||||
|
|
||||||||||||||||
| local -r brew_sha="${BREW_SOURCE_COMMIT:-unset}" | ||||||||||||||||
| local -r head_sha="$(git -C "${ROOTDIR}" rev-parse HEAD 2>/dev/null || echo 'unknown')" | ||||||||||||||||
| local -r delta="${BREW_COMMIT_DELTA:-0}" | ||||||||||||||||
| local -r aligned="${BREW_TEST_ALIGNED:-false}" | ||||||||||||||||
|
|
||||||||||||||||
| local coverage_delta="[]" | ||||||||||||||||
| if [[ "${brew_sha}" != "unset" ]] && [[ "${brew_sha}" != "${head_sha}" ]]; then | ||||||||||||||||
| local added_files | ||||||||||||||||
| added_files=$(git -C "${ROOTDIR}" diff --name-only --diff-filter=A \ | ||||||||||||||||
| "${brew_sha}..HEAD" -- test/suites/ test/resources/ 2>/dev/null || true) | ||||||||||||||||
| if [[ -n "${added_files}" ]]; then | ||||||||||||||||
| coverage_delta=$(echo "${added_files}" | jq -R -s 'split("\n") | map(select(length > 0))') | ||||||||||||||||
| fi | ||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| cat > "${artifact_dir}/brew-alignment.json" <<EOF | ||||||||||||||||
| { | ||||||||||||||||
| "brew_source_commit": "${brew_sha}", | ||||||||||||||||
| "head_commit": "${head_sha}", | ||||||||||||||||
| "commit_delta": ${delta}, | ||||||||||||||||
| "test_aligned": ${aligned}, | ||||||||||||||||
| "max_brew_skew": ${MAX_BREW_SKEW}, | ||||||||||||||||
| "coverage_delta": ${coverage_delta} | ||||||||||||||||
| } | ||||||||||||||||
| EOF | ||||||||||||||||
|
|
||||||||||||||||
| echo "Wrote brew alignment artifact to ${artifact_dir}/brew-alignment.json" | ||||||||||||||||
| } | ||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,8 @@ SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
| source "${SCRIPTDIR}/common.sh" | ||
| # shellcheck source=test/bin/common_versions.sh | ||
| source "${SCRIPTDIR}/common_versions.sh" | ||
| # shellcheck source=test/bin/brew_test_alignment.sh | ||
| source "${SCRIPTDIR}/brew_test_alignment.sh" | ||
|
|
||
| LVM_SYSROOT_SIZE="15360" | ||
| PULL_SECRET="${PULL_SECRET:-${HOME}/.pull-secret.json}" | ||
|
|
@@ -1849,6 +1851,10 @@ action_run() { | |
| start_junit | ||
| trap "close_junit" EXIT | ||
|
|
||
| if [[ "${BREW_TEST_ALIGNED:-false}" == "true" ]]; then | ||
| emit_brew_alignment_artifact | ||
| fi | ||
|
|
||
|
Comment on lines
+1854
to
+1857
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π©Ί Stability & Availability | π Major | β‘ Quick win π§© Analysis chainπ Script executed: #!/bin/bash
set -euo pipefail
rg -n "SCENARIO_INFO_DIR=|^SCENARIO=" test/bin/scenario.sh
rg -n "load_global_settings\(\)|load_scenario_script\(\)" -A5 test/bin/scenario.shRepository: openshift/microshift Length of output: 580 π Script executed: #!/usr/bin/bash
set -euo pipefail
printf '--- scenario.sh action context ---\n'
sed -n '1820,1870p' test/bin/scenario.sh
printf '\n--- brew_test_alignment usages/definitions ---\n'
fd -a 'brew_test_alignment.sh|scenario.sh' . | sed 's#^\./##' | xargs -r -n1 sh -c '
echo "== $0 =="
rg -n "emit_brew_alignment_artifact|SCENARIO_INFO_DIR|SCENARIO_SCRIPT=|SCENARIO=" "$0"
'
printf '\n--- load/load_global/load_scenario sections ---\n'
sed -n '1700,1785p' test/bin/scenario.shRepository: openshift/microshift Length of output: 249 π Script executed: #!/usr/bin/bash
set -euo pipefail
printf '%s\n' '--- scenario.sh action context ---'
sed -n '1820,1870p' test/bin/scenario.sh
printf '%s\n' ''
printf '%s\n' '--- brew_test_alignment usages/definitions ---'
file_re='^test/bin/(scenario\.sh|brew_test_alignment\.sh)$'
if [ -f test/bin/scenario.sh ]; then
rg -n "emit_brew_alignment_artifact|SCENARIO_INFO_DIR|SCENARIO_SCRIPT=|SCENARIO=" test/bin/scenario.sh
fi
if [ -f test/bin/scenario.sh.bash ]; then
rg -n "emit_brew_alignment_artifact|SCENARIO_INFO_DIR|SCENARIO_SCRIPT=|SCENARIO=" test/bin/scenario.sh.bash
fi
if [ -f test/bin/brew_test_alignment.sh ]; then
rg -n "emit_brew_alignment_artifact|SCENARIO_INFO_DIR|SCENARIO_SCRIPT=|SCENARIO=" test/bin/brew_test_alignment.sh
fi
printf '%s\n' ''
printf '%s\n' '--- load sections ---'
sed -n '1700,1785p' test/bin/scenario.shRepository: openshift/microshift Length of output: 5470 Initialize
π€ Prompt for AI Agents |
||
| if ! load_global_settings; then | ||
| record_junit "run" "load_global_settings" "FAILED" | ||
| return 1 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π Maintainability & Code Quality | π‘ Minor | β‘ Quick win
π§© Analysis chain
π Script executed:
Repository: openshift/microshift
Length of output: 1593
π Script executed:
Repository: openshift/microshift
Length of output: 219
Use the approved shell scripting template.
test/bin/brew_test_alignment.shstarts with#!/bin/bashand does not enableset -euo pipefail; use#!/usr/bin/bashand the required strict shell options for shell script files.π€ Prompt for AI Agents
Source: Coding guidelines