Skip to content

Commit 03d00b1

Browse files
Exclude test fixtures from Biome
The fixture apps under packages/testcontainers/fixtures are copied into container images built from node:10-alpine. Biome's useNodejsImportProtocol rewrote their requires to the node: protocol, which Node 10 does not support: Error: Cannot find module 'node:fs' The containers exited immediately on start, which surfaced as "container stopped/paused ... is not running" and "No port binding found for :8080/tcp" in the Dockerfile and buildkit suites. Confirmed by reintroducing a single node: prefix into one fixture, which reproduces the failure, and removing it, which fixes it. These files are container payloads pinned to an old runtime rather than library source, so they are excluded from Biome entirely and restored byte-for-byte to their state on main.
1 parent 84dc048 commit 03d00b1

10 files changed

Lines changed: 46 additions & 46 deletions

File tree

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"useIgnoreFile": true
77
},
88
"files": {
9-
"includes": ["**", "!**/build", "!package-lock.json", "!docs"]
9+
"includes": ["**", "!**/build", "!package-lock.json", "!docs", "!packages/testcontainers/fixtures"]
1010
},
1111
"formatter": {
1212
"enabled": true,

packages/testcontainers/fixtures/docker-compose/docker-compose-with-buildkit/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
const fs = require("node:fs");
2-
const http = require("node:http");
3-
const https = require("node:https");
1+
const fs = require("fs");
2+
const http = require("http");
3+
const https = require("https");
44
const express = require("express");
55

66
const app = express();
77

8-
app.get("/hello-world", (_req, res) => {
8+
app.get("/hello-world", (req, res) => {
99
res.status(200).send("hello-world");
1010
});
1111

12-
app.get("/hello-world-delay", (_req, res) => {
12+
app.get("/hello-world-delay", (req, res) => {
1313
setTimeout(() => {
1414
res.status(200).send("hello-world");
1515
}, 3000);
1616
});
1717

18-
app.post("/hello-world-post", (_req, res) => {
18+
app.post("/hello-world-post", (req, res) => {
1919
res.status(200).send("hello-world");
2020
});
2121

22-
app.get("/env", (_req, res) => {
22+
app.get("/env", (req, res) => {
2323
res.status(200).json(process.env);
2424
});
2525

26-
app.get("/cmd", (_req, res) => {
26+
app.get("/cmd", (req, res) => {
2727
res.status(200).json(process.argv);
2828
});
2929

@@ -40,7 +40,7 @@ app.get("/auth", (req, res) => {
4040
});
4141

4242
app.get("/header-or-400/:headerName", (req, res) => {
43-
if (req.headers[req.params.headerName] !== undefined) {
43+
if (req.headers[req.params["headerName"]] !== undefined) {
4444
res.status(200).end();
4545
} else {
4646
res.status(400).end();

packages/testcontainers/fixtures/docker/docker-with-buildargs/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ const express = require("express");
33
const app = express();
44
const port = 8080;
55

6-
app.get("/hello-world", (_req, res) => {
6+
app.get("/hello-world", (req, res) => {
77
res.status(200).send("hello-world");
88
});
99

10-
app.get("/env", (_req, res) => {
10+
app.get("/env", (req, res) => {
1111
res.status(200).json(process.env);
1212
});
1313

14-
app.get("/cmd", (_req, res) => {
14+
app.get("/cmd", (req, res) => {
1515
res.status(200).json(process.argv);
1616
});
1717

packages/testcontainers/fixtures/docker/docker-with-buildkit/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
const fs = require("node:fs");
2-
const http = require("node:http");
3-
const https = require("node:https");
1+
const fs = require("fs");
2+
const http = require("http");
3+
const https = require("https");
44
const express = require("express");
55

66
const app = express();
77

8-
app.get("/hello-world", (_req, res) => {
8+
app.get("/hello-world", (req, res) => {
99
res.status(200).send("hello-world");
1010
});
1111

12-
app.get("/hello-world-delay", (_req, res) => {
12+
app.get("/hello-world-delay", (req, res) => {
1313
setTimeout(() => {
1414
res.status(200).send("hello-world");
1515
}, 3000);
1616
});
1717

18-
app.post("/hello-world-post", (_req, res) => {
18+
app.post("/hello-world-post", (req, res) => {
1919
res.status(200).send("hello-world");
2020
});
2121

22-
app.get("/env", (_req, res) => {
22+
app.get("/env", (req, res) => {
2323
res.status(200).json(process.env);
2424
});
2525

26-
app.get("/cmd", (_req, res) => {
26+
app.get("/cmd", (req, res) => {
2727
res.status(200).json(process.argv);
2828
});
2929

@@ -40,7 +40,7 @@ app.get("/auth", (req, res) => {
4040
});
4141

4242
app.get("/header-or-400/:headerName", (req, res) => {
43-
if (req.headers[req.params.headerName] !== undefined) {
43+
if (req.headers[req.params["headerName"]] !== undefined) {
4444
res.status(200).end();
4545
} else {
4646
res.status(400).end();

packages/testcontainers/fixtures/docker/docker-with-custom-filename/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ const express = require("express");
33
const app = express();
44
const port = 8080;
55

6-
app.get("/hello-world", (_req, res) => {
6+
app.get("/hello-world", (req, res) => {
77
res.status(200).send("hello-world");
88
});
99

10-
app.get("/env", (_req, res) => {
10+
app.get("/env", (req, res) => {
1111
res.status(200).json(process.env);
1212
});
1313

14-
app.get("/cmd", (_req, res) => {
14+
app.get("/cmd", (req, res) => {
1515
res.status(200).json(process.argv);
1616
});
1717

packages/testcontainers/fixtures/docker/docker-with-dockerignore-nested-exclusions/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ const express = require("express");
33
const app = express();
44
const port = 8080;
55

6-
app.get("/hello-world", (_req, res) => {
6+
app.get("/hello-world", (req, res) => {
77
res.status(200).send("hello-world");
88
});
99

10-
app.get("/env", (_req, res) => {
10+
app.get("/env", (req, res) => {
1111
res.status(200).json(process.env);
1212
});
1313

14-
app.get("/cmd", (_req, res) => {
14+
app.get("/cmd", (req, res) => {
1515
res.status(200).json(process.argv);
1616
});
1717

packages/testcontainers/fixtures/docker/docker-with-dockerignore/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ const express = require("express");
33
const app = express();
44
const port = 8080;
55

6-
app.get("/hello-world", (_req, res) => {
6+
app.get("/hello-world", (req, res) => {
77
res.status(200).send("hello-world");
88
});
99

10-
app.get("/env", (_req, res) => {
10+
app.get("/env", (req, res) => {
1111
res.status(200).json(process.env);
1212
});
1313

14-
app.get("/cmd", (_req, res) => {
14+
app.get("/cmd", (req, res) => {
1515
res.status(200).json(process.argv);
1616
});
1717

packages/testcontainers/fixtures/docker/docker-with-health-check-with-start-period/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ const express = require("express");
33
const app = express();
44
const port = 8080;
55

6-
app.get("/hello-world", (_req, res) => {
6+
app.get("/hello-world", (req, res) => {
77
res.status(200).send("hello-world");
88
});
99

10-
app.get("/env", (_req, res) => {
10+
app.get("/env", (req, res) => {
1111
res.status(200).json(process.env);
1212
});
1313

14-
app.get("/cmd", (_req, res) => {
14+
app.get("/cmd", (req, res) => {
1515
res.status(200).json(process.argv);
1616
});
1717

packages/testcontainers/fixtures/docker/docker-with-health-check/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ const express = require("express");
33
const app = express();
44
const port = 8080;
55

6-
app.get("/hello-world", (_req, res) => {
6+
app.get("/hello-world", (req, res) => {
77
res.status(200).send("hello-world");
88
});
99

10-
app.get("/env", (_req, res) => {
10+
app.get("/env", (req, res) => {
1111
res.status(200).json(process.env);
1212
});
1313

14-
app.get("/cmd", (_req, res) => {
14+
app.get("/cmd", (req, res) => {
1515
res.status(200).json(process.argv);
1616
});
1717

packages/testcontainers/fixtures/docker/docker/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
const fs = require("node:fs");
2-
const http = require("node:http");
3-
const https = require("node:https");
1+
const fs = require("fs");
2+
const http = require("http");
3+
const https = require("https");
44
const express = require("express");
55

66
const app = express();
77

8-
app.get("/hello-world", (_req, res) => {
8+
app.get("/hello-world", (req, res) => {
99
res.status(200).send("hello-world");
1010
});
1111

12-
app.get("/hello-world-delay", (_req, res) => {
12+
app.get("/hello-world-delay", (req, res) => {
1313
setTimeout(() => {
1414
res.status(200).send("hello-world");
1515
}, 3000);
1616
});
1717

18-
app.post("/hello-world-post", (_req, res) => {
18+
app.post("/hello-world-post", (req, res) => {
1919
res.status(200).send("hello-world");
2020
});
2121

22-
app.get("/env", (_req, res) => {
22+
app.get("/env", (req, res) => {
2323
res.status(200).json(process.env);
2424
});
2525

26-
app.get("/cmd", (_req, res) => {
26+
app.get("/cmd", (req, res) => {
2727
res.status(200).json(process.argv);
2828
});
2929

@@ -40,7 +40,7 @@ app.get("/auth", (req, res) => {
4040
});
4141

4242
app.get("/header-or-400/:headerName", (req, res) => {
43-
if (req.headers[req.params.headerName] !== undefined) {
43+
if (req.headers[req.params["headerName"]] !== undefined) {
4444
res.status(200).end();
4545
} else {
4646
res.status(400).end();

0 commit comments

Comments
 (0)