Skip to content
Merged
Show file tree
Hide file tree
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
44 changes: 44 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: E2E Tests

on:
push:
branches: [ "main" ]
paths:
- 'e2e/**'
- '.github/workflows/e2e.yml'
pull_request:
branches: [ "main" ]
paths:
- 'e2e/**'
- '.github/workflows/e2e.yml'

permissions:
contents: read

jobs:
e2e:
name: Run E2E Tests
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
node-version: [ 20.x, 22.x, 24.x ]
os: [ ubuntu-latest, macos-latest, windows-latest ]

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Use Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install E2E Dependencies
working-directory: ./e2e
run: npm ci --ignore-scripts

- name: Run E2E Tests
working-directory: ./e2e
run: npm test
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
4 changes: 4 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
# Node 20/22 this repo supports) does not recognize the setting and silently
# ignores it, so it hardens installs on npm 11+ without breaking older clients.
min-release-age=7

# exclude min-release-age=7 rule for all packages of @pkg-nec organization
# Requires npm >= 12.0.0
min-release-age-exclude[]="@pkg-nec/*"
38 changes: 38 additions & 0 deletions e2e/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# http-server-e2e

An independent, rigorous E2E test suite for `@pkg-nec/http-server`.

**Purpose:** To verify that new upstream versions work flawlessly, prevent regressions, and transparently track known behavior changes over time.

## Version Verification Log

### v14.3.1 & v14.3.0
* **Status:** Verified Stable.
* **Details:** All core E2E tests pass flawlessly with no regressions detected.

### v14.2.0
* **Status:** Verified Stable (with known behavior change).
* **Details:** Documented a change in the `html-encoding-sniffer` package. It was upgraded to conform to the WHATWG Encoding Standard, resulting in `iso-8859-1` being correctly aliased to `windows-1252`. Our test suite was updated to strictly verify this compliance across legacy and modern versions.

### v14.1.4 & v14.1.2
* **Status:** Verified Baseline Stability.
* **Details:** Established robust testing for core features:
* **minimist:** CLI flag parsing, CORS, caching, `--no-dotfiles`, and `--tls` alias.
* **portfinder:** Fallback port allocation when default ports are blocked.
* **Architecture:** Built with strict process isolation and dynamic OS-level port allocation to prevent `EADDRINUSE` race conditions during parallel test execution.

## Running the Suite

To run the test suite locally against a specific upstream version:

```bash
# 1. Clone the repository
git clone <repo-url>
cd http-server-e2e

# 2. Install a target version of the server
npm install @pkg-nec/http-server@14.3.1

# 3. Execute the Tap-based parallel test suite
npm test
```
1 change: 1 addition & 0 deletions e2e/fixtures/.hidden
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
secret
21 changes: 21 additions & 0 deletions e2e/fixtures/arabic.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="ar">
<head>
<meta charset="ISO-8859-6" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ÇäÙÑÈêÉ HTML</title>
</head>

<body>
<h1>Kokoro - Natsume Soseki</h1>
<h2>ÇäåÙäå èÃæÇ</h2>
<h3>èÇÍÏ</h3>
<p>
ÇÙÊÏÊ Ãæ ÃÓåê çÐÇ ÇäÔÎÕ åÏÑÓëÇ. ÍÊé çæÇ ¬ äÇ êåãææê ÇäÇÙÊÑÇá ÈÇÓåê ÇäÍâêâê
ÈåÌÑÏ ÇäãÊÇÈÉ åÙ ÇäåÙäå. çÐÇ ×ÈêÙê ÈÇäæÓÈÉ äê ÃãËÑ åæ ÇäÅÍÌÇå Ùæ ÇäÙÇäå.
áê ãä åÑÉ ÃÊÐãÑ áêçÇ ÐÇãÑÉ Ðäã ÇäÔÎÕ ¬ ÃÑêÏ Ùäé ÇäáèÑ Ãæ Ã×äâ Ùäêç ÇÓå
"ÇäåÙäå". ÍÊé äè ãÊÈÊ áÑÔÇÉ ¬ áÅæ åÔÇÙÑê çê æáÓçÇ. äÇ ÃÔÙÑ ÈÑÚÈÉ áê
ÇÓÊÎÏÇå ÇäÇÎÊÕÇÑÇÊ ÈåÙÒä.
</p>
</body>
</html>
1 change: 1 addition & 0 deletions e2e/fixtures/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"hello": "world"}
1 change: 1 addition & 0 deletions e2e/fixtures/iso.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="iso-8859-1"></head><body>ISO</body></html>
1 change: 1 addition & 0 deletions e2e/fixtures/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("hello");
1 change: 1 addition & 0 deletions e2e/fixtures/utf8.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></head><body>UTF-8</body></html>
Loading
Loading