mirror of
https://github.com/geekjourneyx/md2wechat-skill.git
synced 2026-09-14 17:57:15 +08:00
test(layout): pin contracts to upstream main
This commit is contained in:
@@ -46,7 +46,7 @@ type e2eSettings struct {
|
||||
|
||||
const layoutConformanceRequestTimeout = 30 * time.Second
|
||||
|
||||
const pinnedUpstreamFieldContractSHA = "052346a43deb83d211471bb7b423318f6f6ff6c1"
|
||||
const pinnedUpstreamFieldContractSHA = "0e7027616dd1654802cf11615f6ba8bd23e539ae"
|
||||
|
||||
func layoutConformanceCatalog() (*layoutcatalog.Catalog, error) {
|
||||
catalog := layoutcatalog.NewCatalog()
|
||||
|
||||
@@ -46,7 +46,7 @@ type upstreamAgentContractProjection struct {
|
||||
}
|
||||
|
||||
const upstreamAgentContractContentSHA256 = "c6ca6d8a26b1bc694a8cef72ff6c7d517366f4331bb7ee978dbdae5556636fbd"
|
||||
const upstreamAgentContractProjectionSHA256 = "c6a70f2870102903a75269301999118419e5db2e9e8c7ff7dfd87cd4d7351b5d"
|
||||
const upstreamAgentContractProjectionSHA256 = "463c181d4def8a4c88ac4361febc5c26ae3b39f56acc388cdb7828beb67f92bb"
|
||||
|
||||
func TestUpstreamAgentContractProjectionOracle(t *testing.T) {
|
||||
data, err := os.ReadFile("testdata/upstream_agent_contract_projections.yaml")
|
||||
@@ -60,7 +60,7 @@ func TestUpstreamAgentContractProjectionOracle(t *testing.T) {
|
||||
if got := fmt.Sprintf("%x", sha256.Sum256(data)); got != upstreamAgentContractProjectionSHA256 {
|
||||
t.Fatalf("projection fixture digest = %q, want %q", got, upstreamAgentContractProjectionSHA256)
|
||||
}
|
||||
if oracle.SourceCommit != "052346a43deb83d211471bb7b423318f6f6ff6c1" {
|
||||
if oracle.SourceCommit != "0e7027616dd1654802cf11615f6ba8bd23e539ae" {
|
||||
t.Fatalf("upstream source commit = %q", oracle.SourceCommit)
|
||||
}
|
||||
if want := []string{"__tests__/fixtures/advanced-layout-agent-contract.ts", "advanced-layout-modules-guide.md"}; !slices.Equal(oracle.SourceFiles, want) {
|
||||
@@ -93,7 +93,7 @@ func TestUpstreamAgentContractProjectionOracle(t *testing.T) {
|
||||
|
||||
func TestUpstreamAgentContractOracle(t *testing.T) {
|
||||
oracle := readUpstreamAgentContracts(t)
|
||||
if oracle.SourceCommit != "052346a43deb83d211471bb7b423318f6f6ff6c1" {
|
||||
if oracle.SourceCommit != "0e7027616dd1654802cf11615f6ba8bd23e539ae" {
|
||||
t.Fatalf("upstream source commit = %q", oracle.SourceCommit)
|
||||
}
|
||||
if oracle.SourceFile != "__tests__/fixtures/advanced-layout-agent-contract.ts" {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
source_commit: 052346a43deb83d211471bb7b423318f6f6ff6c1
|
||||
source_commit: 0e7027616dd1654802cf11615f6ba8bd23e539ae
|
||||
source_file: lib/advanced-module-groups.ts
|
||||
source_sha256: eafb8d4167a079a602b9a5fb4ac25c68bbfd9f3d1cb8115808136dada116b437
|
||||
source_sha256: ca78e6c32617ef380fa665f5817049bc9d6d6b502bfd841d42977050dd707756
|
||||
guide_only_recommended_syntax:
|
||||
- figure-caption
|
||||
- gallery-grid
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# normalized agent-contract fixture is kept byte-for-byte pinned to the
|
||||
# upstream test source; this projection pins the PR1 guide's canonical body
|
||||
# representation and variant-only field applicability independently.
|
||||
source_commit: 052346a43deb83d211471bb7b423318f6f6ff6c1
|
||||
source_commit: 0e7027616dd1654802cf11615f6ba8bd23e539ae
|
||||
source_files:
|
||||
- __tests__/fixtures/advanced-layout-agent-contract.ts
|
||||
- advanced-layout-modules-guide.md
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
source_commit: 052346a43deb83d211471bb7b423318f6f6ff6c1
|
||||
source_commit: 0e7027616dd1654802cf11615f6ba8bd23e539ae
|
||||
source_file: __tests__/fixtures/advanced-layout-agent-contract.ts
|
||||
source_sha256: 265b50ae88d3688614273423df1d5de7fddfb899fc7d496a6c88d37ec66ff1d3
|
||||
contracts:
|
||||
|
||||
@@ -104,10 +104,10 @@ dialogue-pair|dialogue-pair|
|
||||
|
||||
func TestRecommendedScenarioMappingMatchesPinnedSources(t *testing.T) {
|
||||
m := readRecommendedScenarioMap(t)
|
||||
if m.SourceCommit != "052346a43deb83d211471bb7b423318f6f6ff6c1" || m.SourceFile != "lib/advanced-module-groups.ts" {
|
||||
if m.SourceCommit != "0e7027616dd1654802cf11615f6ba8bd23e539ae" || m.SourceFile != "lib/advanced-module-groups.ts" {
|
||||
t.Fatalf("source = %q:%q", m.SourceCommit, m.SourceFile)
|
||||
}
|
||||
if m.SourceSHA256 != "eafb8d4167a079a602b9a5fb4ac25c68bbfd9f3d1cb8115808136dada116b437" {
|
||||
if m.SourceSHA256 != "ca78e6c32617ef380fa665f5817049bc9d6d6b502bfd841d42977050dd707756" {
|
||||
t.Fatalf("source digest = %q", m.SourceSHA256)
|
||||
}
|
||||
if len(m.Scenarios) != 77 {
|
||||
|
||||
@@ -4,7 +4,7 @@ set -euo pipefail
|
||||
MD2WECHAT_CLI_COMMIT="${MD2WECHAT_CLI_COMMIT:-$(git rev-parse HEAD)}"
|
||||
output="${LAYOUT_CONFORMANCE_OUTPUT:-/tmp/md2wechat-layout-conformance.jsonl}"
|
||||
mode="${MD2WECHAT_LAYOUT_CONFORMANCE_MODE:-release}"
|
||||
pinned_field_contract_sha="052346a43deb83d211471bb7b423318f6f6ff6c1"
|
||||
pinned_field_contract_sha="0e7027616dd1654802cf11615f6ba8bd23e539ae"
|
||||
|
||||
if [[ "$mode" == "release" ]]; then
|
||||
: "${MD2WECHAT_UPSTREAM_FIELD_CONTRACT_SHA:?release conformance requires MD2WECHAT_UPSTREAM_FIELD_CONTRACT_SHA}"
|
||||
|
||||
Reference in New Issue
Block a user