GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(release): select custom roots in the rstack smoke · registrystack/registry-stack@bae1899

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/workflows
    • release-candidate.yml
  • release/scripts
    • test_release_workflow_structure.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/release-candidate.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/release-candidate.yml
+8-5Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,15 +2463,18 @@ jobs:
24632463
breg evidence
24642464
test -L "${destination}/bin/rstack"
24652465
test "$(find "${destination}/bin" -mindepth 1 -maxdepth 1 | wc -l)" -eq 1
2466-
test "$("${destination}/bin/rstack" --version)" = "rstack ${version}"
2467-
"${destination}/bin/rstack" components list --format json \
2466+
rstack=("${destination}/bin/rstack"
2467+
--bin-dir "${destination}/bin"
2468+
--install-root "${destination}/lib")
2469+
test "$("${rstack[@]}" --version)" = "rstack ${version}"
2470+
"${rstack[@]}" components list --format json \
24682471
| jq -e '.components | any(.name == "breg" and .installed == true)' \
24692472
>/dev/null
2470-
"${destination}/bin/rstack" components list --format json \
2473+
"${rstack[@]}" components list --format json \
24712474
| jq -e '.components | any(.name == "evidence" and .installed == true)' \
24722475
>/dev/null
2473-
test "$("${destination}/bin/rstack" breg --version)" = "bregctl ${version}"
2474-
test "$("${destination}/bin/rstack" evidence --version)" = "evidencectl ${version}"
2476+
test "$("${rstack[@]}" breg --version)" = "bregctl ${version}"
2477+
test "$("${rstack[@]}" evidence --version)" = "evidencectl ${version}"
24752478
24762479
- name: Upload one candidate manifest and bundle
24772480
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
Collapse file

‎release/scripts/test_release_workflow_structure.py‎

Copy file name to clipboardExpand all lines: release/scripts/test_release_workflow_structure.py
+143Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,6 +1069,149 @@ def test_native_macos_optional_component_args_execute_under_system_bash(
10691069
],
10701070
)
10711071

1072+
def test_release_pinned_rstack_smoke_reuses_custom_installation_paths(
1073+
self,
1074+
) -> None:
1075+
_, document = workflow("release-candidate.yml")
1076+
smoke = step_run(
1077+
document,
1078+
"assemble",
1079+
"Smoke release-pinned rstack installation from verified local assets",
1080+
)
1081+
post_install = (
1082+
'set -euo pipefail\nversion="0.44.0"\n'
1083+
'destination="${RUNNER_TEMP}/rstack-install-smoke"\n'
1084+
+ 'test -L '
1085+
+ smoke.split("test -L ", 1)[1]
1086+
)
1087+
1088+
with tempfile.TemporaryDirectory(
1089+
prefix="candidate-rstack-smoke-"
1090+
) as temporary_directory:
1091+
root = Path(temporary_directory)
1092+
runner_temp = root / "runner temp"
1093+
destination = runner_temp / "rstack-install-smoke"
1094+
bin_dir = destination / "bin"
1095+
install_root = destination / "lib"
1096+
stub_dir = root / "stub commands"
1097+
stub = stub_dir / "rstack"
1098+
invocation_log = root / "rstack arguments"
1099+
isolated_home = root / "isolated home"
1100+
bin_dir.mkdir(parents=True)
1101+
install_root.mkdir(parents=True)
1102+
stub_dir.mkdir(parents=True)
1103+
isolated_home.mkdir(parents=True)
1104+
stub.write_text(
1105+
"#!/usr/bin/env bash\n"
1106+
"set -euo pipefail\n"
1107+
'printf "%s\\037" "$@" >> "${CAPTURE_ARGS:?}"\n'
1108+
'printf "\\n" >> "${CAPTURE_ARGS:?}"\n'
1109+
'install_root="${HOME}/.local/lib/registrystack"\n'
1110+
'bin_dir="${HOME}/.local/bin"\n'
1111+
'arguments=("$@")\n'
1112+
"command=()\n"
1113+
'for ((index = 0; index < ${#arguments[@]}; index++)); do\n'
1114+
' case "${arguments[index]}" in\n'
1115+
" --install-root)\n"
1116+
" ((index += 1))\n"
1117+
' install_root="${arguments[index]}"\n'
1118+
" ;;\n"
1119+
" --bin-dir)\n"
1120+
" ((index += 1))\n"
1121+
' bin_dir="${arguments[index]}"\n'
1122+
" ;;\n"
1123+
" --format)\n"
1124+
" ((index += 1))\n"
1125+
" ;;\n"
1126+
" *)\n"
1127+
' command+=("${arguments[index]}")\n'
1128+
" ;;\n"
1129+
" esac\n"
1130+
"done\n"
1131+
"selected=false\n"
1132+
'if [[ "${install_root}" == "${EXPECTED_INSTALL_ROOT:?}" '
1133+
'&& "${bin_dir}" == "${EXPECTED_BIN_DIR:?}" ]]; then\n'
1134+
" selected=true\n"
1135+
"fi\n"
1136+
'case "${command[*]}" in\n'
1137+
' "--version")\n'
1138+
" printf 'rstack 0.44.0\\n'\n"
1139+
" ;;\n"
1140+
' "components list")\n'
1141+
' if [[ "${selected}" == true ]]; then\n'
1142+
" printf '%s\\n' "
1143+
"'{\"schema_version\":\"registry.rstack.components.v1\","
1144+
"\"components\":[{\"name\":\"breg\",\"installed\":true},"
1145+
"{\"name\":\"evidence\",\"installed\":true}]}'\n"
1146+
" else\n"
1147+
" printf '%s\\n' "
1148+
"'{\"schema_version\":\"registry.rstack.components.v1\","
1149+
"\"components\":[{\"name\":\"breg\",\"installed\":false},"
1150+
"{\"name\":\"evidence\",\"installed\":false}]}'\n"
1151+
" fi\n"
1152+
" ;;\n"
1153+
' "breg --version")\n'
1154+
' [[ "${selected}" == true ]]\n'
1155+
" printf 'bregctl 0.44.0\\n'\n"
1156+
" ;;\n"
1157+
' "evidence --version")\n'
1158+
' [[ "${selected}" == true ]]\n'
1159+
" printf 'evidencectl 0.44.0\\n'\n"
1160+
" ;;\n"
1161+
" *)\n"
1162+
" exit 2\n"
1163+
" ;;\n"
1164+
"esac\n",
1165+
encoding="utf-8",
1166+
)
1167+
stub.chmod(0o755)
1168+
(bin_dir / "rstack").symlink_to(stub)
1169+
environment = {
1170+
**os.environ,
1171+
"CAPTURE_ARGS": str(invocation_log),
1172+
"EXPECTED_BIN_DIR": str(bin_dir),
1173+
"EXPECTED_INSTALL_ROOT": str(install_root),
1174+
"HOME": str(isolated_home),
1175+
"RUNNER_TEMP": str(runner_temp),
1176+
}
1177+
result = subprocess.run(
1178+
["/bin/bash", "--noprofile", "--norc"],
1179+
input=post_install,
1180+
cwd=root,
1181+
env=environment,
1182+
capture_output=True,
1183+
text=True,
1184+
check=False,
1185+
)
1186+
invocations = [
1187+
[argument for argument in line.split("\x1f") if argument]
1188+
for line in invocation_log.read_text(encoding="utf-8").splitlines()
1189+
]
1190+
command = [
1191+
"--bin-dir",
1192+
str(bin_dir),
1193+
"--install-root",
1194+
str(install_root),
1195+
]
1196+
self.assertEqual(
1197+
result.returncode,
1198+
0,
1199+
f"stdout={result.stdout!r} stderr={result.stderr!r} "
1200+
f"invocations={invocations!r}",
1201+
)
1202+
self.assertEqual(result.stdout, "")
1203+
self.assertEqual(result.stderr, "")
1204+
self.assertEqual(
1205+
invocations,
1206+
[
1207+
[*command, "--version"],
1208+
[*command, "components", "list", "--format", "json"],
1209+
[*command, "components", "list", "--format", "json"],
1210+
[*command, "breg", "--version"],
1211+
[*command, "evidence", "--version"],
1212+
],
1213+
)
1214+
10721215
def test_release_embeds_evidencectl_tag_and_publishes_latest_alias(self) -> None:
10731216
_, document = workflow("release-candidate.yml")
10741217
assemble = step_run(

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.