Skip to content

Commit fe63d0d

Browse files
committed
test: serve the real buf release assets and cover macOS
The buf fixture listed only the archives, while real releases also ship bare binaries, protoc-gen-buf-* plugins and checksums, so the asset selection among them was untested. Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent a354cf8 commit fe63d0d

4 files changed

Lines changed: 192 additions & 4 deletions

File tree

‎tests/Acceptance/GrpcToolsTest.php‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,28 @@ public function installsWindowsBinaries(): void
5252
Assert::same(\trim($this->dir->read('protoc.exe')), 'fake protoc 33.6 win64');
5353
Assert::same(\trim($this->dir->read('buf.exe')), 'fake buf 1.75.0 Windows x86_64');
5454
Assert::same(\trim($this->dir->read('protoc-gen-php-grpc.exe')), 'fake rr 3.4.0 windows amd64');
55+
Assert::same(FakeGitHub::downloads(), [
56+
'buf-Windows-x86_64.zip',
57+
'protoc-33.6-win64.zip',
58+
'protoc-gen-php-grpc-3.4.0-windows-amd64.zip',
59+
]);
60+
}
61+
62+
public function installsMacosBinaries(): void
63+
{
64+
$this->installProtobuf('5.36.2');
65+
66+
$result = $this->rr()->run(['get-grpc-tools', '--os=darwin', '--arch=arm64']);
67+
68+
Assert::same($result->exitCode, 0, (string) $result);
69+
Assert::same(\trim($this->dir->read('buf')), 'fake buf 1.75.0 Darwin arm64');
70+
Assert::same(\trim($this->dir->read('protoc')), 'fake protoc 36.2 osx-universal_binary');
71+
Assert::same(\trim($this->dir->read('protoc-gen-php-grpc')), 'fake rr 3.4.0 darwin arm64');
72+
Assert::same(FakeGitHub::downloads(), [
73+
'buf-Darwin-arm64.tar.gz',
74+
'protoc-36.2-osx-universal_binary.zip',
75+
'protoc-gen-php-grpc-3.4.0-darwin-arm64.tar.gz',
76+
]);
5577
}
5678

5779
public function installsLatestProtocWithoutRuntime(): void

‎tests/Acceptance/Server/releases-buf.json‎

Lines changed: 168 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,192 @@
33
"tag_name": "v2.0.0",
44
"prerelease": false,
55
"assets": [
6+
"buf-Darwin-arm64",
7+
"buf-Darwin-arm64.tar.gz",
8+
"buf-Darwin-x86_64",
9+
"buf-Darwin-x86_64.tar.gz",
10+
"buf-FreeBSD-arm64",
11+
"buf-FreeBSD-arm64.tar.gz",
12+
"buf-FreeBSD-x86_64",
13+
"buf-FreeBSD-x86_64.tar.gz",
14+
"buf-Linux-aarch64",
15+
"buf-Linux-aarch64.tar.gz",
16+
"buf-Linux-armv7",
17+
"buf-Linux-armv7.tar.gz",
18+
"buf-Linux-ppc64le",
19+
"buf-Linux-ppc64le.tar.gz",
20+
"buf-Linux-riscv64",
21+
"buf-Linux-riscv64.tar.gz",
22+
"buf-Linux-s390x",
23+
"buf-Linux-s390x.tar.gz",
24+
"buf-Linux-x86_64",
625
"buf-Linux-x86_64.tar.gz",
7-
"buf-Windows-x86_64.zip"
26+
"buf-OpenBSD-arm64",
27+
"buf-OpenBSD-arm64.tar.gz",
28+
"buf-OpenBSD-x86_64",
29+
"buf-OpenBSD-x86_64.tar.gz",
30+
"buf-Windows-arm64.exe",
31+
"buf-Windows-arm64.zip",
32+
"buf-Windows-x86_64.exe",
33+
"buf-Windows-x86_64.zip",
34+
"protoc-gen-buf-breaking-Darwin-arm64",
35+
"protoc-gen-buf-breaking-Darwin-x86_64",
36+
"protoc-gen-buf-breaking-FreeBSD-arm64",
37+
"protoc-gen-buf-breaking-FreeBSD-x86_64",
38+
"protoc-gen-buf-breaking-Linux-aarch64",
39+
"protoc-gen-buf-breaking-Linux-armv7",
40+
"protoc-gen-buf-breaking-Linux-ppc64le",
41+
"protoc-gen-buf-breaking-Linux-riscv64",
42+
"protoc-gen-buf-breaking-Linux-s390x",
43+
"protoc-gen-buf-breaking-Linux-x86_64",
44+
"protoc-gen-buf-breaking-OpenBSD-arm64",
45+
"protoc-gen-buf-breaking-OpenBSD-x86_64",
46+
"protoc-gen-buf-breaking-Windows-arm64.exe",
47+
"protoc-gen-buf-breaking-Windows-x86_64.exe",
48+
"protoc-gen-buf-lint-Darwin-arm64",
49+
"protoc-gen-buf-lint-Darwin-x86_64",
50+
"protoc-gen-buf-lint-FreeBSD-arm64",
51+
"protoc-gen-buf-lint-FreeBSD-x86_64",
52+
"protoc-gen-buf-lint-Linux-aarch64",
53+
"protoc-gen-buf-lint-Linux-armv7",
54+
"protoc-gen-buf-lint-Linux-ppc64le",
55+
"protoc-gen-buf-lint-Linux-riscv64",
56+
"protoc-gen-buf-lint-Linux-s390x",
57+
"protoc-gen-buf-lint-Linux-x86_64",
58+
"protoc-gen-buf-lint-OpenBSD-arm64",
59+
"protoc-gen-buf-lint-OpenBSD-x86_64",
60+
"protoc-gen-buf-lint-Windows-arm64.exe",
61+
"protoc-gen-buf-lint-Windows-x86_64.exe",
62+
"sha256.txt",
63+
"sha256.txt.minisig"
864
]
965
},
1066
{
1167
"tag_name": "v1.75.0",
1268
"prerelease": false,
1369
"assets": [
70+
"buf-Darwin-arm64",
1471
"buf-Darwin-arm64.tar.gz",
72+
"buf-Darwin-x86_64",
73+
"buf-Darwin-x86_64.tar.gz",
74+
"buf-FreeBSD-arm64",
75+
"buf-FreeBSD-arm64.tar.gz",
76+
"buf-FreeBSD-x86_64",
77+
"buf-FreeBSD-x86_64.tar.gz",
78+
"buf-Linux-aarch64",
1579
"buf-Linux-aarch64.tar.gz",
80+
"buf-Linux-armv7",
81+
"buf-Linux-armv7.tar.gz",
82+
"buf-Linux-ppc64le",
83+
"buf-Linux-ppc64le.tar.gz",
84+
"buf-Linux-riscv64",
85+
"buf-Linux-riscv64.tar.gz",
86+
"buf-Linux-s390x",
87+
"buf-Linux-s390x.tar.gz",
88+
"buf-Linux-x86_64",
1689
"buf-Linux-x86_64.tar.gz",
90+
"buf-OpenBSD-arm64",
91+
"buf-OpenBSD-arm64.tar.gz",
92+
"buf-OpenBSD-x86_64",
93+
"buf-OpenBSD-x86_64.tar.gz",
94+
"buf-Windows-arm64.exe",
95+
"buf-Windows-arm64.zip",
96+
"buf-Windows-x86_64.exe",
1797
"buf-Windows-x86_64.zip",
18-
"protoc-gen-buf-lint-Linux-x86_64"
98+
"protoc-gen-buf-breaking-Darwin-arm64",
99+
"protoc-gen-buf-breaking-Darwin-x86_64",
100+
"protoc-gen-buf-breaking-FreeBSD-arm64",
101+
"protoc-gen-buf-breaking-FreeBSD-x86_64",
102+
"protoc-gen-buf-breaking-Linux-aarch64",
103+
"protoc-gen-buf-breaking-Linux-armv7",
104+
"protoc-gen-buf-breaking-Linux-ppc64le",
105+
"protoc-gen-buf-breaking-Linux-riscv64",
106+
"protoc-gen-buf-breaking-Linux-s390x",
107+
"protoc-gen-buf-breaking-Linux-x86_64",
108+
"protoc-gen-buf-breaking-OpenBSD-arm64",
109+
"protoc-gen-buf-breaking-OpenBSD-x86_64",
110+
"protoc-gen-buf-breaking-Windows-arm64.exe",
111+
"protoc-gen-buf-breaking-Windows-x86_64.exe",
112+
"protoc-gen-buf-lint-Darwin-arm64",
113+
"protoc-gen-buf-lint-Darwin-x86_64",
114+
"protoc-gen-buf-lint-FreeBSD-arm64",
115+
"protoc-gen-buf-lint-FreeBSD-x86_64",
116+
"protoc-gen-buf-lint-Linux-aarch64",
117+
"protoc-gen-buf-lint-Linux-armv7",
118+
"protoc-gen-buf-lint-Linux-ppc64le",
119+
"protoc-gen-buf-lint-Linux-riscv64",
120+
"protoc-gen-buf-lint-Linux-s390x",
121+
"protoc-gen-buf-lint-Linux-x86_64",
122+
"protoc-gen-buf-lint-OpenBSD-arm64",
123+
"protoc-gen-buf-lint-OpenBSD-x86_64",
124+
"protoc-gen-buf-lint-Windows-arm64.exe",
125+
"protoc-gen-buf-lint-Windows-x86_64.exe",
126+
"sha256.txt",
127+
"sha256.txt.minisig"
19128
]
20129
},
21130
{
22131
"tag_name": "v1.74.0",
23132
"prerelease": false,
24133
"assets": [
134+
"buf-Darwin-arm64",
135+
"buf-Darwin-arm64.tar.gz",
136+
"buf-Darwin-x86_64",
137+
"buf-Darwin-x86_64.tar.gz",
138+
"buf-FreeBSD-arm64",
139+
"buf-FreeBSD-arm64.tar.gz",
140+
"buf-FreeBSD-x86_64",
141+
"buf-FreeBSD-x86_64.tar.gz",
142+
"buf-Linux-aarch64",
143+
"buf-Linux-aarch64.tar.gz",
144+
"buf-Linux-armv7",
145+
"buf-Linux-armv7.tar.gz",
146+
"buf-Linux-ppc64le",
147+
"buf-Linux-ppc64le.tar.gz",
148+
"buf-Linux-riscv64",
149+
"buf-Linux-riscv64.tar.gz",
150+
"buf-Linux-s390x",
151+
"buf-Linux-s390x.tar.gz",
152+
"buf-Linux-x86_64",
25153
"buf-Linux-x86_64.tar.gz",
26-
"buf-Windows-x86_64.zip"
154+
"buf-OpenBSD-arm64",
155+
"buf-OpenBSD-arm64.tar.gz",
156+
"buf-OpenBSD-x86_64",
157+
"buf-OpenBSD-x86_64.tar.gz",
158+
"buf-Windows-arm64.exe",
159+
"buf-Windows-arm64.zip",
160+
"buf-Windows-x86_64.exe",
161+
"buf-Windows-x86_64.zip",
162+
"protoc-gen-buf-breaking-Darwin-arm64",
163+
"protoc-gen-buf-breaking-Darwin-x86_64",
164+
"protoc-gen-buf-breaking-FreeBSD-arm64",
165+
"protoc-gen-buf-breaking-FreeBSD-x86_64",
166+
"protoc-gen-buf-breaking-Linux-aarch64",
167+
"protoc-gen-buf-breaking-Linux-armv7",
168+
"protoc-gen-buf-breaking-Linux-ppc64le",
169+
"protoc-gen-buf-breaking-Linux-riscv64",
170+
"protoc-gen-buf-breaking-Linux-s390x",
171+
"protoc-gen-buf-breaking-Linux-x86_64",
172+
"protoc-gen-buf-breaking-OpenBSD-arm64",
173+
"protoc-gen-buf-breaking-OpenBSD-x86_64",
174+
"protoc-gen-buf-breaking-Windows-arm64.exe",
175+
"protoc-gen-buf-breaking-Windows-x86_64.exe",
176+
"protoc-gen-buf-lint-Darwin-arm64",
177+
"protoc-gen-buf-lint-Darwin-x86_64",
178+
"protoc-gen-buf-lint-FreeBSD-arm64",
179+
"protoc-gen-buf-lint-FreeBSD-x86_64",
180+
"protoc-gen-buf-lint-Linux-aarch64",
181+
"protoc-gen-buf-lint-Linux-armv7",
182+
"protoc-gen-buf-lint-Linux-ppc64le",
183+
"protoc-gen-buf-lint-Linux-riscv64",
184+
"protoc-gen-buf-lint-Linux-s390x",
185+
"protoc-gen-buf-lint-Linux-x86_64",
186+
"protoc-gen-buf-lint-OpenBSD-arm64",
187+
"protoc-gen-buf-lint-OpenBSD-x86_64",
188+
"protoc-gen-buf-lint-Windows-arm64.exe",
189+
"protoc-gen-buf-lint-Windows-x86_64.exe",
190+
"sha256.txt",
191+
"sha256.txt.minisig"
27192
]
28193
}
29194
]

‎tests/Acceptance/Server/releases.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"tag_name": "v3.4.0",
2424
"prerelease": false,
2525
"assets": [
26+
"protoc-gen-php-grpc-3.4.0-darwin-arm64.tar.gz",
2627
"protoc-gen-php-grpc-3.4.0-linux-amd64.tar.gz",
2728
"protoc-gen-php-grpc-3.4.0-linux-arm64.tar.gz",
2829
"protoc-gen-php-grpc-3.4.0-windows-amd64.zip",

‎tests/Acceptance/VersionsTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function listsStableReleasesNewestFirst(): void
2626
Assert::same($result->exitCode, 0, (string) $result);
2727
Assert::same(self::releases($result->stdout), ['3.4.0', '3.2.0', '3.1.0', '2025.1.5', '2.12.3']);
2828
Assert::string($result->stdout)
29-
->matchesRegex('/^\s*3\.4\.0\s+stable\s+✓\s+\(8\)\s+✓\s*$/mu')
29+
->matchesRegex('/^\s*3\.4\.0\s+stable\s+✓\s+\(9\)\s+✓\s*$/mu')
3030
->matchesRegex('/^\s*2025\.1\.5\s+stable\s+.*\(reason: incompatible version\)/mu');
3131
Assert::same(\count(FakeGitHub::releaseRequests()), 1);
3232
}

0 commit comments

Comments
 (0)