chore(test): vendor the XSTS archive (unmodified) under Tests/Fixtures (#322)
Saves the W3C XML Schema Test Suite (2006-11-06) in the repo as the complete, unmodified xsts-2007-06-20.tar.gz (4.4 MB), the only form the W3C Document License permits redistributing. The extracted 39,399 files are still never committed (that would be a modified redistribution). A README records the provenance, SHA-256, and license. scripts/fetch-xsts.sh now extracts this vendored archive when present (no network) and only downloads as a fallback. The archive is excluded from the test bundle in Package.swift since the runner reads it off disk via XSTS_ROOT, not from resources.
This commit is contained in:
parent
6b2cf2a429
commit
925172cd84
@ -25,6 +25,9 @@ let package = Package(
|
|||||||
name: "PureXMLTests",
|
name: "PureXMLTests",
|
||||||
dependencies: ["PureXML"],
|
dependencies: ["PureXML"],
|
||||||
path: "Tests",
|
path: "Tests",
|
||||||
|
// The vendored XSTS archive is consumed off-disk via XSTS_ROOT, never
|
||||||
|
// from the test bundle, so keep it out of the copied resources.
|
||||||
|
exclude: ["Fixtures/xsts"],
|
||||||
resources: [
|
resources: [
|
||||||
.copy("Fixtures"),
|
.copy("Fixtures"),
|
||||||
],
|
],
|
||||||
|
|||||||
31
Tests/Fixtures/xsts/README.md
Normal file
31
Tests/Fixtures/xsts/README.md
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# W3C XML Schema Test Suite (XSTS): vendored archive
|
||||||
|
|
||||||
|
`xsts-2007-06-20.tar.gz` is the complete, unmodified W3C XML Schema Test Suite,
|
||||||
|
2006-11-06 release (14,383 settled cases across roughly 39,399 files), exactly as
|
||||||
|
published by the W3C.
|
||||||
|
|
||||||
|
- Source: <https://www.w3.org/XML/2004/xml-schema-test-suite/xmlschema2006-11-06/xsts-2007-06-20.tar.gz>
|
||||||
|
- SHA-256: `902176b25e4111cf96b08663107521a4992e8ea67aad6b815592a6a5b4b9ea06`
|
||||||
|
- Size: 4,367,182 bytes
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
The suite is published under the W3C Document License, which permits
|
||||||
|
redistribution only as the complete, unmodified archive. This file is that
|
||||||
|
archive, byte for byte, kept in its original `.tar.gz` form for that reason.
|
||||||
|
|
||||||
|
Do not commit the extracted files. Extracting them and committing the loose
|
||||||
|
files is a modified redistribution and is not permitted by the license. Keep the
|
||||||
|
archive sealed; extract it locally instead (see below).
|
||||||
|
|
||||||
|
## Use
|
||||||
|
|
||||||
|
Extract it to the path the conformance runner expects, then point `XSTS_ROOT` at
|
||||||
|
the result:
|
||||||
|
|
||||||
|
bash scripts/fetch-xsts.sh
|
||||||
|
export XSTS_ROOT=/private/tmp/xsts/xmlschema2006-11-06
|
||||||
|
XSTS_ROOT=$XSTS_ROOT swift test -c release --filter XSTSSuiteTests
|
||||||
|
|
||||||
|
`scripts/fetch-xsts.sh` extracts this vendored archive when it is present (no
|
||||||
|
network needed) and falls back to downloading it from the W3C otherwise.
|
||||||
BIN
Tests/Fixtures/xsts/xsts-2007-06-20.tar.gz
Normal file
BIN
Tests/Fixtures/xsts/xsts-2007-06-20.tar.gz
Normal file
Binary file not shown.
@ -2,10 +2,11 @@
|
|||||||
# Fetch the W3C XML Schema Test Suite (XSTS, 2006-11-06 release) to the path the
|
# Fetch the W3C XML Schema Test Suite (XSTS, 2006-11-06 release) to the path the
|
||||||
# conformance runner (Tests/XSTSSuiteTests.swift) expects.
|
# conformance runner (Tests/XSTSSuiteTests.swift) expects.
|
||||||
#
|
#
|
||||||
# The suite is never vendored: the W3C Document License permits redistribution
|
# The extracted suite is never vendored: the W3C Document License permits
|
||||||
# only as the complete unmodified archive, and the corpus is about 200 MB across
|
# redistribution only as the complete unmodified archive, and the corpus is about
|
||||||
# 39,399 files. This script downloads the official archive on demand and verifies
|
# 200 MB across 39,399 files. The unmodified archive itself is vendored at
|
||||||
# its SHA-256 before extracting.
|
# Tests/Fixtures/xsts; this script extracts that when present (no network), or
|
||||||
|
# downloads the official archive otherwise, verifying its SHA-256 before extracting.
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# bash scripts/fetch-xsts.sh
|
# bash scripts/fetch-xsts.sh
|
||||||
@ -28,8 +29,15 @@ fi
|
|||||||
|
|
||||||
mkdir -p "$dest"
|
mkdir -p "$dest"
|
||||||
archive="$dest/xsts-2007-06-20.tar.gz"
|
archive="$dest/xsts-2007-06-20.tar.gz"
|
||||||
echo "xsts: downloading the 2006-11-06 archive (about 4.4 MB)"
|
script_dir="$(cd "$(dirname "$0")" && pwd)"
|
||||||
curl -fsSL -o "$archive" "$url"
|
vendored="$script_dir/../Tests/Fixtures/xsts/xsts-2007-06-20.tar.gz"
|
||||||
|
if [ -f "$vendored" ]; then
|
||||||
|
echo "xsts: using the vendored archive (no download)"
|
||||||
|
cp "$vendored" "$archive"
|
||||||
|
else
|
||||||
|
echo "xsts: downloading the 2006-11-06 archive (about 4.4 MB)"
|
||||||
|
curl -fsSL -o "$archive" "$url"
|
||||||
|
fi
|
||||||
|
|
||||||
# Verify integrity before extracting (portable across macOS and Linux).
|
# Verify integrity before extracting (portable across macOS and Linux).
|
||||||
if command -v shasum >/dev/null 2>&1; then
|
if command -v shasum >/dev/null 2>&1; then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user