Skip to content

Commit 3e5f45b

Browse files
authored
Add regression tests for CJK characters (#471)
* Add regression tests for CJK characters * Dedupe the names and remove the ignored `name` param * Bump @actions/artifact to v6.2.1 * Run `npm run release` * Update licenses
1 parent e6d03f6 commit 3e5f45b

6 files changed

Lines changed: 329 additions & 270 deletions

File tree

.github/workflows/test.yml

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,3 +187,136 @@ jobs:
187187
ls -al ext-test/raw/
188188
exit 1
189189
fi
190+
191+
# Test uploading and downloading artifacts with CJK (Chinese, Japanese, Korean) characters
192+
# Regression test: certain non-ASCII chars (e.g. U+571F 土) caused 400 errors from
193+
# Azure Blob Storage due to encoding issues in the Content-Disposition / rscd parameter
194+
- name: Create artifacts with CJK names
195+
shell: bash
196+
run: |
197+
mkdir -p path/to/cjk-artifacts
198+
# Chinese - 土 (U+571F) known to fail, 日 (U+65E5) known to work
199+
echo "Content for 土" > "path/to/cjk-artifacts/file-土-${{ matrix.runs-on }}.txt"
200+
echo "Content for 中文测试" > "path/to/cjk-artifacts/file-中文测试-${{ matrix.runs-on }}.txt"
201+
# Japanese - katakana and kanji
202+
echo "Content for テスト" > "path/to/cjk-artifacts/file-テスト-${{ matrix.runs-on }}.txt"
203+
echo "Content for 東京タワー" > "path/to/cjk-artifacts/file-東京タワー-${{ matrix.runs-on }}.txt"
204+
# Korean - Hangul
205+
echo "Content for 테스트" > "path/to/cjk-artifacts/file-테스트-${{ matrix.runs-on }}.txt"
206+
echo "Content for 서울시" > "path/to/cjk-artifacts/file-서울시-${{ matrix.runs-on }}.txt"
207+
208+
- name: Upload CJK artifact - Chinese 土
209+
uses: actions/upload-artifact@v7
210+
with:
211+
path: path/to/cjk-artifacts/file-土-${{ matrix.runs-on }}.txt
212+
archive: false
213+
214+
- name: Upload CJK artifact - Chinese 中文测试
215+
uses: actions/upload-artifact@v7
216+
with:
217+
path: path/to/cjk-artifacts/file-中文测试-${{ matrix.runs-on }}.txt
218+
archive: false
219+
220+
- name: Upload CJK artifact - Japanese テスト
221+
uses: actions/upload-artifact@v7
222+
with:
223+
path: path/to/cjk-artifacts/file-テスト-${{ matrix.runs-on }}.txt
224+
archive: false
225+
226+
- name: Upload CJK artifact - Japanese 東京タワー
227+
uses: actions/upload-artifact@v7
228+
with:
229+
path: path/to/cjk-artifacts/file-東京タワー-${{ matrix.runs-on }}.txt
230+
archive: false
231+
232+
- name: Upload CJK artifact - Korean 테스트
233+
uses: actions/upload-artifact@v7
234+
with:
235+
path: path/to/cjk-artifacts/file-테스트-${{ matrix.runs-on }}.txt
236+
archive: false
237+
238+
- name: Upload CJK artifact - Korean 서울시
239+
uses: actions/upload-artifact@v7
240+
with:
241+
path: path/to/cjk-artifacts/file-서울시-${{ matrix.runs-on }}.txt
242+
archive: false
243+
244+
- name: Download CJK artifact - Chinese 土
245+
uses: ./
246+
with:
247+
name: file-土-${{ matrix.runs-on }}.txt
248+
path: cjk-download/土
249+
250+
- name: Download CJK artifact - Chinese 中文测试
251+
uses: ./
252+
with:
253+
name: file-中文测试-${{ matrix.runs-on }}.txt
254+
path: cjk-download/中文测试
255+
256+
- name: Download CJK artifact - Japanese テスト
257+
uses: ./
258+
with:
259+
name: file-テスト-${{ matrix.runs-on }}.txt
260+
path: cjk-download/テスト
261+
262+
- name: Download CJK artifact - Japanese 東京タワー
263+
uses: ./
264+
with:
265+
name: file-東京タワー-${{ matrix.runs-on }}.txt
266+
path: cjk-download/東京タワー
267+
268+
- name: Download CJK artifact - Korean 테스트
269+
uses: ./
270+
with:
271+
name: file-테스트-${{ matrix.runs-on }}.txt
272+
path: cjk-download/테스트
273+
274+
- name: Download CJK artifact - Korean 서울시
275+
uses: ./
276+
with:
277+
name: file-서울시-${{ matrix.runs-on }}.txt
278+
path: cjk-download/서울시
279+
280+
- name: Verify CJK artifact downloads
281+
shell: bash
282+
run: |
283+
set -e
284+
fail=0
285+
286+
check_file() {
287+
local file="$1"
288+
local expected="$2"
289+
if [ ! -f "$file" ]; then
290+
echo "FAIL: Missing file: $file"
291+
fail=1
292+
return
293+
fi
294+
actual=$(cat "$file")
295+
if [ "$actual" != "$expected" ]; then
296+
echo "FAIL: Content mismatch in $file"
297+
echo " Expected: '$expected'"
298+
echo " Got: '$actual'"
299+
fail=1
300+
return
301+
fi
302+
echo "PASS: $file"
303+
}
304+
305+
echo "=== Chinese ==="
306+
check_file "cjk-download/土/file-土-${{ matrix.runs-on }}.txt" "Content for 土"
307+
check_file "cjk-download/中文测试/file-中文测试-${{ matrix.runs-on }}.txt" "Content for 中文测试"
308+
309+
echo "=== Japanese ==="
310+
check_file "cjk-download/テスト/file-テスト-${{ matrix.runs-on }}.txt" "Content for テスト"
311+
check_file "cjk-download/東京タワー/file-東京タワー-${{ matrix.runs-on }}.txt" "Content for 東京タワー"
312+
313+
echo "=== Korean ==="
314+
check_file "cjk-download/테스트/file-테스트-${{ matrix.runs-on }}.txt" "Content for 테스트"
315+
check_file "cjk-download/서울시/file-서울시-${{ matrix.runs-on }}.txt" "Content for 서울시"
316+
317+
if [ "$fail" -ne 0 ]; then
318+
echo "Some CJK artifact checks failed"
319+
ls -alR cjk-download/ || true
320+
exit 1
321+
fi
322+
echo "All CJK artifact downloads verified successfully"

.licenses/npm/@actions/artifact.dep.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ See also [upload-artifact](https://github.com/actions/upload-artifact).
3838

3939
- Chore: we've bumped versions on a lot of our dev packages to get them up to date with the latest bugfixes/security patches.
4040

41+
### v8.0.1
42+
43+
- Support for CJK (Chinese/Japanese/Korean) characters in the file name.
44+
4145
## v7 - What's new
4246

4347
> [!IMPORTANT]

0 commit comments

Comments
 (0)