Skip to content

Add support for any in lkp docker install #469

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

Merged
merged 1 commit into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ The alternative method to run the job is

```
lkp docker test -i $image -j hackbench.yaml -g pipe-8-process-1600 --hostname $hostname

# The flag --any can be set to let lkp randomly choose a job from the suite
lkp docker test -i $image -j hackbench.yaml --any --hostname $hostname
```

## Test by lkp docker
Expand Down
12 changes: 8 additions & 4 deletions docker/test
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ while getopts "d:i:j:g:t:-:" opt; do
;;
-)
case "${OPTARG}" in
any)
opt_any="--any"
;;
container)
opt_container="${!OPTIND}"
OPTIND=$((OPTIND + 1))
Expand Down Expand Up @@ -84,15 +87,16 @@ test()
local pattern="$2"
local action="$3"
local proxy="$4"
local opt_any="$5"

# echo "$(whoami): $FUNCNAME: '$job_yaml' '$pattern' '$proxy'"
# echo "$(whoami): $FUNCNAME: '$job_yaml' '$pattern' '$proxy' '$opt_any'"

[[ "$job_yaml" == /* ]] || job_yaml=/lkp/lkp-tests/jobs/$job_yaml

local job_dir=/lkp/jobs/$(basename "$job_yaml")

mkdir -p $job_dir
lkp split-job "$job_yaml" -o $job_dir || return
lkp split-job "$job_yaml" $opt_any -o $job_dir || return

local jobs=($job_dir/*$pattern*.yaml)

Expand All @@ -113,9 +117,9 @@ script_name=$(basename $0)

case $script_name in
install)
docker exec $opt_hostname bash -c "$(declare -f test); test \"$opt_job_yaml\" \"$opt_pattern\" \"install\" \"$opt_proxy\""
docker exec $opt_hostname bash -c "$(declare -f test); test \"$opt_job_yaml\" \"$opt_pattern\" \"install\" \"$opt_proxy\" \"$opt_any\""
;;
test)
docker exec $opt_hostname bash -c "$(declare -f test); test \"$opt_job_yaml\" \"$opt_pattern\" \"test\" \"$opt_proxy\""
docker exec $opt_hostname bash -c "$(declare -f test); test \"$opt_job_yaml\" \"$opt_pattern\" \"test\" \"$opt_proxy\" \"$opt_any\""
;;
esac