Skip to content

Commit e1f8fb8

Browse files
authored
Merge pull request #1254 from rhatdan/pull
Change default testing to use --pull=missing
2 parents 173ebea + 01b5014 commit e1f8fb8

File tree

6 files changed

+18
-7
lines changed

6 files changed

+18
-7
lines changed

docs/ramalama.conf.5.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ options in previously read ramalama.conf files.
3535
Config files in the `.d` directories, are added in alpha numeric sorted order and must end in `.conf`.
3636

3737
## ENVIRONMENT VARIABLES
38-
If the `RAMALAMA_CONF` environment variable is set, all system and user
38+
If the `RAMALAMA_CONFIG` environment variable is set, all system and user
3939
config files are ignored and only the specified config file is loaded.
4040

4141
# FORMAT

test/system/030-run.bats

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ MODEL=smollm:1.7b
99
conf=$RAMALAMA_TMPDIR/ramalama.conf
1010
cat >$conf <<EOF
1111
[ramalama]
12-
pull="missing"
12+
pull="never"
1313
EOF
1414

1515
if is_container; then
@@ -30,7 +30,7 @@ EOF
3030
run_ramalama -q --dryrun run --oci-runtime foobar ${MODEL}
3131
is "$output" ".*--runtime foobar" "dryrun correct with --oci-runtime"
3232

33-
run_ramalama -q --dryrun run --seed 9876 -c 4096 --net bridge --name foobar ${MODEL}
33+
RAMALAMA_CONFIG=/dev/null run_ramalama -q --dryrun run --seed 9876 -c 4096 --net bridge --name foobar ${MODEL}
3434
is "$output" ".*--network bridge.*" "dryrun correct with --name"
3535
is "$output" ".*${MODEL}" "verify model name"
3636
is "$output" ".*-c 4096" "verify ctx-size is set"
@@ -40,11 +40,14 @@ EOF
4040
is "$output" ".*--pull newer" "verify pull is newer"
4141
fi
4242

43+
run_ramalama -q --dryrun run ${MODEL}
44+
is "$output" ".*--pull missing" "verify test defaults"
45+
4346
run_ramalama -q --dryrun run --pull=never -c 4096 --name foobar ${MODEL}
4447
is "$output" ".*--pull never" "verify pull is never"
4548

4649
RAMALAMA_CONFIG=${conf} run_ramalama -q --dryrun run ${MODEL}
47-
is "$output" ".*--pull missing" "verify pull is missing"
50+
is "$output" ".*--pull never" "verify pull is missing"
4851

4952
run_ramalama 2 -q --dryrun run --pull=bogus ${MODEL}
5053
is "$output" ".*error: argument --pull: invalid choice: 'bogus'" "verify pull can not be bogus"

test/system/040-serve.bats

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,17 @@ verify_begin=".*run --rm"
3636
run_ramalama -q --dryrun serve --temp 0.1 ${model}
3737
is "$output" ".*--temp 0.1" "verify temp is set"
3838

39-
run_ramalama -q --dryrun serve --seed 1234 ${model}
39+
RAMALAMA_CONFIG=/dev/null run_ramalama -q --dryrun serve --seed 1234 ${model}
4040
is "$output" ".*--seed 1234" "verify seed is set"
4141
if not_docker; then
4242
is "$output" ".*--pull newer" "verify pull is newer"
4343
fi
4444
assert "$output" =~ ".*--cap-drop=all" "verify --cap-add is present"
4545
assert "$output" =~ ".*no-new-privileges" "verify --no-new-privs is not present"
4646

47+
run_ramalama -q --dryrun serve ${model}
48+
is "$output" ".*--pull missing" "verify test default pull is missing"
49+
4750
run_ramalama -q --dryrun serve --pull never ${model}
4851
is "$output" ".*--pull never" "verify pull is never"
4952

test/system/070-rag.bats

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ load helpers
1616
run_ramalama --dryrun run --rag quay.io/ramalama/myrag:1.2 ollama://smollm:135m
1717
is "$output" ".*quay.io/ramalama/.*-rag.*" "Expected to use -rag image"
1818
if not_docker; then
19+
is "$output" ".*--pull missing.*" "Expected to use --pull missing"
20+
RAMALAMA_CONFIG=/dev/null run_ramalama --dryrun run --rag quay.io/ramalama/myrag:1.2 ollama://smollm:135m
1921
is "$output" ".*--pull newer.*" "Expected to use --pull newer"
2022
fi
2123

test/system/helpers.bash

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
# RamaLama command to run;
44
RAMALAMA=${RAMALAMA:-ramalama}
55

6-
# RamaLama testing helper used in 331-system-check tests
7-
RAMALAMA_TESTING=${RAMALAMA_TESTING:-$(dirname ${BASH_SOURCE})/../../bin/ramalama-testing}
6+
export RAMALAMA_CONFIG=${RAMALAMA_CONFIG:-./test/system/ramalama.conf}
87

98
# llama.cpp or vllm, unlikely to change. Cache, because it's expensive to determine.
109
RAMALAMA_RUNTIME=

test/system/ramalama.conf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[ramalama]
2+
3+
pull="missing"
4+

0 commit comments

Comments
 (0)