Reuse the frozen Linux archive for release smoke and artifact delivery
This commit is contained in:
1 parent
e4c4a852d0
commit
1390f0081b
5 files changed
+86
-83
No files matched your search
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env bash
|
||||
# Exercise only the shipped Linux archive on the supported glibc baseline.
|
||||
set -euo pipefail
|
||||
|
||||
if [[ $# != 2 || ! $2 =~ ^[a-f0-9]{40}$ ]]; then
|
||||
echo "usage: $0 <archive.tar.gz> <source-sha>" >&2
|
||||
exit 2
|
||||
fi
|
||||
archive="$(realpath "$1")"
|
||||
source_sha="$2"
|
||||
name="$(basename "$archive")"
|
||||
if [[ ! $name =~ ^marqdo-(.+)-x86_64-unknown-linux-gnu\.tar\.gz$ ]]; then
|
||||
echo "unexpected archive name: $name" >&2
|
||||
exit 2
|
||||
fi
|
||||
version="${BASH_REMATCH[1]}"
|
||||
(
|
||||
cd "$(dirname "$archive")"
|
||||
sha256sum --check --status "$name.sha256"
|
||||
)
|
||||
|
||||
docker run --rm --network none --user 65534:65534 \
|
||||
--mount "type=bind,source=$archive,target=/archive.tar.gz,readonly" \
|
||||
ubuntu:24.04 sh -eu -c '
|
||||
test "$(getconf GNU_LIBC_VERSION)" = "glibc 2.39"
|
||||
if command -v cargo; then
|
||||
echo "unexpected Cargo binary in the runtime container" >&2
|
||||
exit 1
|
||||
fi
|
||||
mkdir /tmp/marqdo
|
||||
tar -xzf /archive.tar.gz -C /tmp/marqdo
|
||||
cd "/tmp/marqdo/marqdo-$1-x86_64-unknown-linux-gnu"
|
||||
test "$(cat SOURCE_SHA)" = "$2"
|
||||
test "$(./marqdo --version)" = "marqdo $1"
|
||||
./marqdo --help >/dev/null
|
||||
test -x ./marqdo-provider-worker
|
||||
./marqdo run examples/hello.mq.md | grep -F "你好,Marqdo"
|
||||
./marqdo check examples/multi-module/index.mq.md --emit /tmp/analysis.json
|
||||
./marqdo call examples/math-library-demo.mq.md main
|
||||
test "$(./marqdo call examples/factorial.mq.md 阶乘 --arg n=5)" = 120
|
||||
./marqdo run tests/consumers/fixtures/execution-events/basic.mq.md \
|
||||
--event-stream jsonl >/tmp/events.jsonl
|
||||
tail -n 1 /tmp/events.jsonl | grep -Eq "\"kind\"[[:space:]]*:[[:space:]]*\"run.completed\""
|
||||
mv stdlib stdlib.hidden
|
||||
if ./marqdo run examples/hello.mq.md >/tmp/missing-stdlib.log 2>&1; then
|
||||
echo "run succeeded without the shipped stdlib" >&2
|
||||
exit 1
|
||||
fi
|
||||
grep -E "stdlib|symbol\.unknown|打印" /tmp/missing-stdlib.log
|
||||
' sh "$version" "$source_sha"
|
||||
@@ -16,7 +16,7 @@ Usage (from the repository root, after
|
||||
|
||||
python3 tools/release/package.py \
|
||||
--source-sha "$(git rev-parse HEAD)" \
|
||||
--version 3.0.0-beta.1
|
||||
--version 3.0.0-rc.1
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -266,6 +266,7 @@ def stage(stage_dir: Path, version: str, source_sha: str, target: str) -> dict:
|
||||
"protocols": {
|
||||
"analysis": 2,
|
||||
"trace": 2,
|
||||
"execution_events": 1,
|
||||
"tool": 1,
|
||||
"plugin_abi": "1.x",
|
||||
"foreign_wire": 1,
|
||||
|
||||
@@ -9,7 +9,7 @@ Provider v2 worker (positive, unauthorized and missing-helper fail-closed), and
|
||||
strict mode when the host genuinely supports it.
|
||||
|
||||
Usage:
|
||||
python3 tools/release/smoke.py --archive dist/marqdo-3.0.0-beta.1-x86_64-unknown-linux-gnu.tar.gz
|
||||
python3 tools/release/smoke.py --archive dist/marqdo-3.0.0-rc.1-x86_64-unknown-linux-gnu.tar.gz
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -302,6 +302,10 @@ def main(argv: list[str]) -> int:
|
||||
]
|
||||
if not events or events[0].get("kind") != "stream.opened":
|
||||
fail("Execution Events stream does not start with stream.opened")
|
||||
if events[0].get("payload", {}).get("producer", {}).get("version") != version:
|
||||
fail("Execution Events producer.version does not match the product version")
|
||||
if events[0].get("schema_version") != info["protocols"].get("execution_events"):
|
||||
fail("Execution Events schema_version does not match RELEASE_INFO.json")
|
||||
if events[-1].get("kind") != "run.completed":
|
||||
fail("Execution Events stream has no successful terminal event")
|
||||
validate_events = subprocess.run(
|
||||
|
||||
Reference in new issue
Block a user