Skip to content

Commit d9dd9ac

Browse files
sjarmakclaude
andcommitted
fix: ansible verifier Unicode bug, add --tasks prebuild filter, fix base image deps
1. ansible-abc-imports-fix-001: Replace broken inline test IDs (Czech/Ukrainian \u/\x escapes not interpreted by bash) with module-level pytest invocation. Previously scored 0.0 for both configs because pytest found zero matching tests. 2. prebuild_images.sh: Add --tasks filter (comma-separated IDs or @file path) so only specific tasks' images are built instead of all tasks in a suite. Update _common.sh prebuild_images() wrapper to pass through additional args. 3. validate_one_per_benchmark.sh: Add base image build step before smoke tests. Tasks using FROM ccb-repo-* failed with "pull access denied" because Docker tried to pull local-only base images from Docker Hub. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9242c8e commit d9dd9ac

File tree

4 files changed

+59
-5
lines changed

4 files changed

+59
-5
lines changed

benchmarks/ccb_fix/ansible-abc-imports-fix-001/tests/test.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,16 @@ else
160160
fi
161161

162162
echo "Running specific pytest tests..."
163-
echo "Tests: "test/units/executor/module_common/test_recursive_finder.py::TestRecursiveFinder::test_no_module_utils" "test/units/executor/module_common/test_recursive_finder.py::TestRecursiveFinder::test_import_six_from_many_submodules" "test/units/executor/module_common/test_recursive_finder.py::TestRecursiveFinder::test_import_six" "test/units/executor/module_common/test_recursive_finder.py::TestRecursiveFinder::test_from_import_six" "test/units/executor/module_common/test_recursive_finder.py::TestRecursiveFinder::test_module_utils_with_identation_error" "test/units/executor/module_common/test_recursive_finder.py::TestRecursiveFinder::test_module_utils_with_syntax_error" "test/units/module_utils/common/test_collections.py::test_sequence_negative[non_sequence_input2]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_with_strings[he0]" "test/units/module_utils/common/test_collections.py::test_sequence_negative[non_sequence_input0]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_with_strings[\xd0\xa3\xd0\xba\xd1\x80\xd0\xb0\xd1\x97\xd0\xbd\xd0\xb0]" "test/units/module_utils/common/test_collections.py::TestImmutableDict::test_len" "test/units/module_utils/common/test_collections.py::test_iterable_excluding_strings[\u0423\u043a\u0440\u0430\u0457\u043d\u0430]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_with_strings[\u010cesk\xe1" "test/units/module_utils/common/test_collections.py::test_iterable_negative[seq0]" "test/units/module_utils/common/test_collections.py::test_iterable_positive[seq4]" "test/units/module_utils/common/test_collections.py::TestImmutableDict::test_container" "test/units/module_utils/common/test_collections.py::test_iterable_positive[seq0]" "test/units/module_utils/common/test_collections.py::test_sequence_negative[he1]" "test/units/module_utils/common/test_collections.py::test_iterable_including_strings[he0]" "test/units/module_utils/common/test_collections.py::TestImmutableDict::test_scalar" "test/units/module_utils/common/test_collections.py::test_iterable_positive[seq2]" "test/units/module_utils/common/test_collections.py::TestImmutableDict::test_hashable" "test/units/module_utils/common/test_collections.py::test_iterable_excluding_strings[he1]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_without_strings[\xc4\x8cesk\xc3\xa1" "test/units/module_utils/common/test_collections.py::test_sequence_negative[\xc4\x8cesk\xc3\xa1" "test/units/module_utils/common/test_collections.py::test_iterable_including_strings[string_input6]" "test/units/module_utils/common/test_collections.py::test_iterable_negative[5]" "test/units/module_utils/common/test_collections.py::test_iterable_including_strings[\u010cesk\xe1" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_without_strings[\u0423\u043a\u0440\u0430\u0457\u043d\u0430]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_without_strings[he1]" "test/units/module_utils/common/test_collections.py::test_sequence_negative[0.0]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_with_strings[\u0423\u043a\u0440\u0430\u0457\u043d\u0430]" "test/units/module_utils/common/test_collections.py::test_sequence_negative[4]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_with_strings[string_input6]" "test/units/module_utils/common/test_collections.py::test_sequence_positive[sequence_input2]" "test/units/module_utils/common/test_collections.py::test_sequence_positive[sequence_input0]" "test/units/module_utils/common/test_collections.py::TestImmutableDict::test_from_kwargs" "test/units/module_utils/common/test_collections.py::test_iterable_including_strings[\xd0\xa3\xd0\xba\xd1\x80\xd0\xb0\xd1\x97\xd0\xbd\xd0\xb0]" "test/units/module_utils/common/test_collections.py::TestImmutableDict::test_repr" "test/units/module_utils/common/test_collections.py::test_iterable_excluding_strings[\xc4\x8cesk\xc3\xa1" "test/units/module_utils/common/test_collections.py::test_sequence_negative[\u0423\u043a\u0440\u0430\u0457\u043d\u0430]" "test/units/module_utils/common/test_collections.py::test_iterable_negative[seq1]" "test/units/module_utils/common/test_collections.py::test_iterable_excluding_strings[\u010cesk\xe1" "test/units/module_utils/common/test_collections.py::test_sequence_negative[non_sequence_input1]" "test/units/module_utils/common/test_collections.py::test_iterable_positive[seq1]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_with_strings[\xc4\x8cesk\xc3\xa1" "test/units/module_utils/common/test_collections.py::TestImmutableDict::test_from_tuples" "test/units/module_utils/common/test_collections.py::TestImmutableDict::test_nonhashable" "test/units/module_utils/common/test_collections.py::TestImmutableDict::test_immutable" "test/units/module_utils/common/test_collections.py::test_sequence_negative[non_sequence_input11]" "test/units/module_utils/common/test_collections.py::TestImmutableDict::test_string" "test/units/module_utils/common/test_collections.py::test_sequence_negative[he0]" "test/units/module_utils/common/test_collections.py::test_iterable_negative[9.0]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_without_strings[\xd0\xa3\xd0\xba\xd1\x80\xd0\xb0\xd1\x97\xd0\xbd\xd0\xb0]" "test/units/module_utils/common/test_collections.py::test_iterable_positive[seq5]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_without_strings[\u010cesk\xe1" "test/units/module_utils/common/test_collections.py::test_sequence_positive[sequence_input3]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_without_strings[string_input6]" "test/units/module_utils/common/test_collections.py::test_sequence_negative[\xd0\xa3\xd0\xba\xd1\x80\xd0\xb0\xd1\x97\xd0\xbd\xd0\xb0]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_with_strings[he1]" "test/units/module_utils/common/test_collections.py::test_iterable_positive[seq3]" "test/units/module_utils/common/test_collections.py::test_iterable_excluding_strings[string_input6]" "test/units/module_utils/common/test_collections.py::test_iterable_including_strings[he1]" "test/units/module_utils/common/test_collections.py::test_iterable_excluding_strings[\xd0\xa3\xd0\xba\xd1\x80\xd0\xb0\xd1\x97\xd0\xbd\xd0\xb0]" "test/units/module_utils/common/test_collections.py::test_iterable_including_strings[\u0423\u043a\u0440\u0430\u0457\u043d\u0430]" "test/units/module_utils/common/test_collections.py::test_iterable_including_strings[\xc4\x8cesk\xc3\xa1" "test/units/module_utils/common/test_collections.py::test_sequence_negative[\u010cesk\xe1" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_without_strings[he0]" "test/units/module_utils/common/test_collections.py::test_sequence_positive[sequence_input1]" "test/units/module_utils/common/test_collections.py::test_iterable_excluding_strings[he0]""
163+
echo "Test modules: test_recursive_finder.py (TestRecursiveFinder) + test_collections.py"
164164

165-
# Run only the specific tests from fail_to_pass and pass_to_pass
166-
python -m pytest "test/units/executor/module_common/test_recursive_finder.py::TestRecursiveFinder::test_no_module_utils" "test/units/executor/module_common/test_recursive_finder.py::TestRecursiveFinder::test_import_six_from_many_submodules" "test/units/executor/module_common/test_recursive_finder.py::TestRecursiveFinder::test_import_six" "test/units/executor/module_common/test_recursive_finder.py::TestRecursiveFinder::test_from_import_six" "test/units/executor/module_common/test_recursive_finder.py::TestRecursiveFinder::test_module_utils_with_identation_error" "test/units/executor/module_common/test_recursive_finder.py::TestRecursiveFinder::test_module_utils_with_syntax_error" "test/units/module_utils/common/test_collections.py::test_sequence_negative[non_sequence_input2]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_with_strings[he0]" "test/units/module_utils/common/test_collections.py::test_sequence_negative[non_sequence_input0]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_with_strings[\xd0\xa3\xd0\xba\xd1\x80\xd0\xb0\xd1\x97\xd0\xbd\xd0\xb0]" "test/units/module_utils/common/test_collections.py::TestImmutableDict::test_len" "test/units/module_utils/common/test_collections.py::test_iterable_excluding_strings[\u0423\u043a\u0440\u0430\u0457\u043d\u0430]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_with_strings[\u010cesk\xe1" "test/units/module_utils/common/test_collections.py::test_iterable_negative[seq0]" "test/units/module_utils/common/test_collections.py::test_iterable_positive[seq4]" "test/units/module_utils/common/test_collections.py::TestImmutableDict::test_container" "test/units/module_utils/common/test_collections.py::test_iterable_positive[seq0]" "test/units/module_utils/common/test_collections.py::test_sequence_negative[he1]" "test/units/module_utils/common/test_collections.py::test_iterable_including_strings[he0]" "test/units/module_utils/common/test_collections.py::TestImmutableDict::test_scalar" "test/units/module_utils/common/test_collections.py::test_iterable_positive[seq2]" "test/units/module_utils/common/test_collections.py::TestImmutableDict::test_hashable" "test/units/module_utils/common/test_collections.py::test_iterable_excluding_strings[he1]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_without_strings[\xc4\x8cesk\xc3\xa1" "test/units/module_utils/common/test_collections.py::test_sequence_negative[\xc4\x8cesk\xc3\xa1" "test/units/module_utils/common/test_collections.py::test_iterable_including_strings[string_input6]" "test/units/module_utils/common/test_collections.py::test_iterable_negative[5]" "test/units/module_utils/common/test_collections.py::test_iterable_including_strings[\u010cesk\xe1" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_without_strings[\u0423\u043a\u0440\u0430\u0457\u043d\u0430]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_without_strings[he1]" "test/units/module_utils/common/test_collections.py::test_sequence_negative[0.0]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_with_strings[\u0423\u043a\u0440\u0430\u0457\u043d\u0430]" "test/units/module_utils/common/test_collections.py::test_sequence_negative[4]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_with_strings[string_input6]" "test/units/module_utils/common/test_collections.py::test_sequence_positive[sequence_input2]" "test/units/module_utils/common/test_collections.py::test_sequence_positive[sequence_input0]" "test/units/module_utils/common/test_collections.py::TestImmutableDict::test_from_kwargs" "test/units/module_utils/common/test_collections.py::test_iterable_including_strings[\xd0\xa3\xd0\xba\xd1\x80\xd0\xb0\xd1\x97\xd0\xbd\xd0\xb0]" "test/units/module_utils/common/test_collections.py::TestImmutableDict::test_repr" "test/units/module_utils/common/test_collections.py::test_iterable_excluding_strings[\xc4\x8cesk\xc3\xa1" "test/units/module_utils/common/test_collections.py::test_sequence_negative[\u0423\u043a\u0440\u0430\u0457\u043d\u0430]" "test/units/module_utils/common/test_collections.py::test_iterable_negative[seq1]" "test/units/module_utils/common/test_collections.py::test_iterable_excluding_strings[\u010cesk\xe1" "test/units/module_utils/common/test_collections.py::test_sequence_negative[non_sequence_input1]" "test/units/module_utils/common/test_collections.py::test_iterable_positive[seq1]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_with_strings[\xc4\x8cesk\xc3\xa1" "test/units/module_utils/common/test_collections.py::TestImmutableDict::test_from_tuples" "test/units/module_utils/common/test_collections.py::TestImmutableDict::test_nonhashable" "test/units/module_utils/common/test_collections.py::TestImmutableDict::test_immutable" "test/units/module_utils/common/test_collections.py::test_sequence_negative[non_sequence_input11]" "test/units/module_utils/common/test_collections.py::TestImmutableDict::test_string" "test/units/module_utils/common/test_collections.py::test_sequence_negative[he0]" "test/units/module_utils/common/test_collections.py::test_iterable_negative[9.0]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_without_strings[\xd0\xa3\xd0\xba\xd1\x80\xd0\xb0\xd1\x97\xd0\xbd\xd0\xb0]" "test/units/module_utils/common/test_collections.py::test_iterable_positive[seq5]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_without_strings[\u010cesk\xe1" "test/units/module_utils/common/test_collections.py::test_sequence_positive[sequence_input3]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_without_strings[string_input6]" "test/units/module_utils/common/test_collections.py::test_sequence_negative[\xd0\xa3\xd0\xba\xd1\x80\xd0\xb0\xd1\x97\xd0\xbd\xd0\xb0]" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_with_strings[he1]" "test/units/module_utils/common/test_collections.py::test_iterable_positive[seq3]" "test/units/module_utils/common/test_collections.py::test_iterable_excluding_strings[string_input6]" "test/units/module_utils/common/test_collections.py::test_iterable_including_strings[he1]" "test/units/module_utils/common/test_collections.py::test_iterable_excluding_strings[\xd0\xa3\xd0\xba\xd1\x80\xd0\xb0\xd1\x97\xd0\xbd\xd0\xb0]" "test/units/module_utils/common/test_collections.py::test_iterable_including_strings[\u0423\u043a\u0440\u0430\u0457\u043d\u0430]" "test/units/module_utils/common/test_collections.py::test_iterable_including_strings[\xc4\x8cesk\xc3\xa1" "test/units/module_utils/common/test_collections.py::test_sequence_negative[\u010cesk\xe1" "test/units/module_utils/common/test_collections.py::test_sequence_string_types_without_strings[he0]" "test/units/module_utils/common/test_collections.py::test_sequence_positive[sequence_input1]" "test/units/module_utils/common/test_collections.py::test_iterable_excluding_strings[he0]" -v 2>&1 | tee test_output.log
165+
# Run the specific test modules that contain all fail_to_pass and pass_to_pass tests.
166+
# Individual test IDs are NOT used because parametrized tests contain Czech and
167+
# Ukrainian characters whose escape sequences are not interpreted by bash,
168+
# causing pytest to find zero matching tests and score 0.0.
169+
python -m pytest \
170+
"test/units/executor/module_common/test_recursive_finder.py::TestRecursiveFinder" \
171+
"test/units/module_utils/common/test_collections.py" \
172+
-v 2>&1 | tee test_output.log
167173
TEST_EXIT_CODE=$?
168174

169175
# Write reward for Harbor with partial credit

configs/_common.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,16 @@ ensure_base_images() {
206206

207207
# Pre-build all Docker images for a suite to warm the layer cache.
208208
# Call before run_paired_configs so Harbor's docker compose build is instant.
209-
# Args: $1 = suite name (e.g., ccb_build), or empty for all suites
209+
# Args: $1 = suite name (e.g., ccb_build), remaining args passed through
210+
# Example: prebuild_images "ccb_build" --tasks "task1,task2"
210211
prebuild_images() {
211212
local suite="${1:-}"
213+
shift || true
212214
local repo_root
213215
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
214216
local script="${repo_root}/scripts/prebuild_images.sh"
215217
if [ -x "$script" ]; then
216-
bash "$script" ${suite:+"$suite"}
218+
bash "$script" ${suite:+"$suite"} "$@"
217219
fi
218220
}
219221

configs/validate_one_per_benchmark.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,16 @@ fi
170170

171171
mkdir -p "$JOBS_DIR"
172172

173+
# Ensure ccb-repo-* base images are built before Docker builds.
174+
# Without this, tasks using FROM ccb-repo-* fail with "pull access denied"
175+
# because Docker tries to pull the local-only image from Docker Hub.
176+
BASE_BUILD="$REPO_ROOT/base_images/build.sh"
177+
if [ -x "$BASE_BUILD" ]; then
178+
echo "=== Ensuring base images ==="
179+
bash "$BASE_BUILD" --parallel 2>&1 | tail -3 || true
180+
echo ""
181+
fi
182+
173183
PIDS=()
174184
BMS=()
175185
declare -A PATH_BY_BM

scripts/prebuild_images.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@
66
# Usage:
77
# ./scripts/prebuild_images.sh [SUITE...] [OPTIONS]
88
# ./scripts/prebuild_images.sh ccb_build ccb_fix
9+
# ./scripts/prebuild_images.sh ccb_build --tasks task1,task2,task3
10+
# ./scripts/prebuild_images.sh --tasks @/tmp/task_list.txt
911
# ./scripts/prebuild_images.sh # all 8 suites
1012
# PREBUILD_JOBS=12 ./scripts/prebuild_images.sh
1113
#
1214
# Options:
15+
# --tasks TASKS Comma-separated task IDs or @/path/to/file (one ID per line)
1316
# --baseline-only Skip SG_only images
1417
# --sgonly-only Skip baseline images
1518
# --dry-run Print what would be built without building
@@ -28,6 +31,7 @@ FORCE=false
2831
SKIP_BASELINE=false
2932
SKIP_SGONLY=false
3033
SUITES=()
34+
TASKS_FILTER=""
3135

3236
while [[ $# -gt 0 ]]; do
3337
case $1 in
@@ -36,11 +40,37 @@ while [[ $# -gt 0 ]]; do
3640
--dry-run) DRY_RUN=true; shift ;;
3741
--force) FORCE=true; shift ;;
3842
--jobs) PREBUILD_JOBS="$2"; shift 2 ;;
43+
--tasks) TASKS_FILTER="$2"; shift 2 ;;
3944
ccb_*) SUITES+=("$1"); shift ;;
4045
*) echo "Unknown option: $1"; exit 1 ;;
4146
esac
4247
done
4348

49+
# Parse --tasks filter into an associative array for O(1) lookup
50+
declare -A TASK_FILTER_SET
51+
if [ -n "$TASKS_FILTER" ]; then
52+
if [[ "$TASKS_FILTER" == @* ]]; then
53+
# Format: @/path/to/file (one task ID per line)
54+
_tasks_file="${TASKS_FILTER:1}"
55+
if [ ! -f "$_tasks_file" ]; then
56+
echo "ERROR: Task file not found: $_tasks_file"
57+
exit 1
58+
fi
59+
while IFS= read -r _line; do
60+
[[ "$_line" =~ ^#.*$ || -z "$_line" ]] && continue
61+
TASK_FILTER_SET["$_line"]=1
62+
done < "$_tasks_file"
63+
else
64+
# Format: comma-separated task IDs
65+
IFS=',' read -ra _tasks <<< "$TASKS_FILTER"
66+
for _tid in "${_tasks[@]}"; do
67+
_tid=$(echo "$_tid" | xargs) # trim whitespace
68+
[ -n "$_tid" ] && TASK_FILTER_SET["$_tid"]=1
69+
done
70+
fi
71+
echo "Task filter: ${#TASK_FILTER_SET[@]} task(s)"
72+
fi
73+
4474
if [ ${#SUITES[@]} -eq 0 ]; then
4575
SUITES=(ccb_build ccb_debug ccb_design ccb_document ccb_fix ccb_secure ccb_test ccb_understand)
4676
fi
@@ -84,6 +114,12 @@ for suite in "${SUITES[@]}"; do
84114
for task_dir in "$suite_dir"/*/; do
85115
[ -d "$task_dir" ] || continue
86116
task_id=$(basename "$task_dir")
117+
118+
# Apply --tasks filter if specified
119+
if [ ${#TASK_FILTER_SET[@]} -gt 0 ] && [ -z "${TASK_FILTER_SET[$task_id]:-}" ]; then
120+
continue
121+
fi
122+
87123
env_dir="${task_dir}environment"
88124

89125
# Baseline image

0 commit comments

Comments
 (0)