| 1 | #!/usr/bin/env bash |
| 2 | # Run the real 1.x readers/writers against each other's disposable framed stores. |
| 3 | set -euo pipefail |
| 4 | root=$(cd "$(dirname "$0")/.." && pwd) |
| 5 | scratch=$(mktemp -d "${TMPDIR:-/tmp}/reasonix-provider-compat.XXXXXX") |
| 6 | trap 'rm -rf "$scratch"' EXIT |
| 7 | fixture=internal/session/provider_diagnostic_compat_test.go |
| 8 | run_fixture() { |
| 9 | (cd "$1" && REASONIX_COMPAT_STORE="$2" REASONIX_COMPAT_MODE="$3" REASONIX_COMPAT_KIND="$4" \ |
| 10 | go test -p 2 ./internal/session -run '^TestProviderDiagnosticCrossVersionFixture$' -count=1) |
| 11 | } |
| 12 | for version in v1.39.8 v1.39.9; do |
| 13 | snapshot="$scratch/$version" |
| 14 | mkdir -p "$snapshot" |
| 15 | git -C "$root" archive "$version" | tar -x -C "$snapshot" |
| 16 | cp "$root/$fixture" "$snapshot/$fixture" |
| 17 | for kind in request_send_timeout image_input; do |
| 18 | run_fixture "$root" "$scratch/new-to-$version-$kind" write "$kind" |
| 19 | run_fixture "$snapshot" "$scratch/new-to-$version-$kind" read "$kind" |
| 20 | done |
| 21 | run_fixture "$snapshot" "$scratch/$version-to-new" write temporary |
| 22 | run_fixture "$root" "$scratch/$version-to-new" read temporary |
| 23 | printf 'PASS %s: bidirectional replay, continued write and reopen\n' "$version" |
| 24 | done |
| 25 |