Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions contributions/65638.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
pr-url: https://github.com/nodejs/node/pull/65638
---

## 문제 내용

### WPT PR을 올리게 된 배경

WPT의 FAIL 상태인 테스트를 기여하려고 했습니다. 하지만 해당 wpt가 아직 node repository에 반영이 안되어있어서, wpt를 먼저 반영하는 PR을 올렸습니다.


## 해결 과정과 검증

### 1. 새 WPT 테스트 추가하기

wpt 추가는 아래 링크 방식을 따라서 진행하였습니다.

- https://github.com/nodejs/node/blob/main/test/wpt/README.md?utm_source=chatgpt.com#how-to-add-tests-for-a-new-module

```bash
$ git node wpt stream
# 만약 node 명령어를 인식할 수 없다면, npm install -g @node-core/utils 를 통해 설치
```

위 명령어를 통해 streams WPT를 가져왔습니다.

### 2. 실패 테스트 상태 수정하기

현 상태에서 올리면 테스트 시, 실패로 처리되기 때문에 테스트들을 expected failure로 변경할 필요가 있었습니다.

#### 2.1. 테스트 네이밍 변경

네이밍이 변경되어 실패한 테스트들은 해당 테스트들의 이름을 수정하였습니다.

- [WPT 테스트 이름 변경 PR](https://github.com/web-platform-tests/wpt/pull/59593)

#### 2.2. 테스트 반환값 변경으로 실패

2개의 실패 테스트가 있었는데, wpt 입력 변수값이 문자열로 변경됨에 따라 기존 테스트가 실패한 것입니다. wpt 변경 내용은 아래 링크에서 확인할 수 있습니다.

- [wpt 변경 내용](https://github.com/web-platform-tests/wpt/pull/59594/changes)

## 배운 점

#### Node.js 가 WPT를 어떻게 언제 갱신하는가?

Node.js는 매일 GitHub Actions를 실행해서, Daily WPT report를 생성하고 이를 wpt.fyi에 업로드합니다. 그래서 repo상에는 없는 wpt이지만, wpt.fyi에 반영되어있는 지를 확인할 수 있습니다.

```yml
name: WPT update

on:
schedule:
# Run once a week at 12:00 AM UTC on Sunday. (일주일에 한번 자동으로 실행)
- cron: 0 0 * * 0
workflow_dispatch:
inputs:
subsystems:
description: Subsystem to run the update for
required: false
default: '["url", "urlpattern", "WebCryptoAPI"]' # 기본 wpt 반영 모듈
```
위 코드는 wpt 자동 업데이트 yml입니다. 자동 업데이트의 기본 wpt 모듈은 "url", "urlpattern", "WebCryptoAPI" 3가지 뿐이고, 그 외의 모듈들(ex streams 등) 들은 모두 수동으로 위 workflow를 실행해야합니다.