Skip to content

Commit 29aec20

Browse files
committed
Fix query parameter test to run in parallel
1 parent 95e26d4 commit 29aec20

2 files changed

Lines changed: 15 additions & 11 deletions

File tree

pulpcore/cli/file/repository.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,11 @@ def repository(ctx: click.Context, pulp_ctx: PulpCLIContext, /, repo_type: str)
153153
),
154154
]
155155

156-
repository.add_command(list_command(decorators=[label_select_option]))
156+
repository.add_command(
157+
list_command(
158+
decorators=[label_select_option, click.option("--name-startswith", "name__startswith")]
159+
)
160+
)
157161
repository.add_command(show_command(decorators=lookup_options))
158162
repository.add_command(create_command(decorators=create_options))
159163
repository.add_command(update_command(decorators=lookup_options + update_options))

tests/scripts/pulpcore/test_query_params.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,37 @@ set -eu
77
pulp debug has-plugin --name "file" || exit 23
88

99
cleanup() {
10-
pulp file repository destroy --name aaaaaaaaaa || true
11-
pulp file repository destroy --name bbbbbbbbbb || true
12-
pulp file repository destroy --name cccccccccc || true
10+
pulp file repository destroy --name query_params_aaaaaaaaaa || true
11+
pulp file repository destroy --name query_params_bbbbbbbbbb || true
12+
pulp file repository destroy --name query_params_cccccccccc || true
1313
}
1414
trap cleanup EXIT
1515

16-
expect_succ pulp file repository create --name aaaaaaaaaa
17-
expect_succ pulp file repository create --name bbbbbbbbbb
18-
expect_succ pulp file repository create --name cccccccccc
16+
expect_succ pulp file repository create --name query_params_aaaaaaaaaa
17+
expect_succ pulp file repository create --name query_params_bbbbbbbbbb
18+
expect_succ pulp file repository create --name query_params_cccccccccc
1919

20-
expect_succ pulp file repository list --ordering -name
20+
expect_succ pulp file repository list --ordering -name --name-startswith query_params
2121
if ! (echo "$OUTPUT" | jq -r .[].name | sort -r -C -); then
2222
echo -e "Ordered results are not in a reverse alphabetical order.\n$(echo "$OUTPUT" | jq -r .[].name)"
2323
exit 1
2424
fi
2525

26-
expect_succ pulp file repository list --ordering name
26+
expect_succ pulp file repository list --ordering name --name-startswith query_params
2727
if ! (echo "$OUTPUT" | jq -r .[].name | sort -C -); then
2828
echo -e "Ordered results are not in an alphabetical order.\n$(echo "$OUTPUT" | jq -r .[].name)"
2929
exit 1
3030
fi
3131

32-
expect_succ pulp file repository list --field name --field remote
32+
expect_succ pulp file repository list --field name --field remote --name-startswith query_params
3333
SELECTED_FIELDS=$(echo "$OUTPUT" | jq -r ".[] | keys[]" | sort -u | tr "\n" " " | xargs)
3434
EXPECTED_FIELDS="name remote"
3535
if [[ "$SELECTED_FIELDS" != "$EXPECTED_FIELDS" ]]; then
3636
echo "Selected fields do not match: {$SELECTED_FIELDS} != {$EXPECTED_FIELDS}"
3737
exit 1
3838
fi
3939

40-
expect_succ pulp file repository list --exclude-field name --exclude-field remote
40+
expect_succ pulp file repository list --exclude-field name --exclude-field remote --name-startswith query_params
4141
EXCLUDED_FIELDS=$(echo "$OUTPUT" | jq -r ".[] | keys[]" | tr "\n" " " )
4242

4343
if [[ "$EXCLUDED_FIELDS" == *"name"* ]]; then

0 commit comments

Comments
 (0)