mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
maybe work
This commit is contained in:
14
.github/workflows/run-test.yml
vendored
14
.github/workflows/run-test.yml
vendored
@@ -24,6 +24,17 @@ jobs:
|
||||
test:
|
||||
name: Tests
|
||||
runs-on: ${{ inputs.runs-on }}
|
||||
|
||||
services:
|
||||
verdaccio:
|
||||
image: verdaccio/verdaccio:5
|
||||
ports:
|
||||
- 4873:4873
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20]
|
||||
|
||||
steps:
|
||||
- if: ${{ runner.os == 'Windows' }}
|
||||
name: Setup Git
|
||||
@@ -70,7 +81,7 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: Install Dependencies
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
@@ -96,6 +107,7 @@ jobs:
|
||||
TLS_POSTGRES_DATABASE_URL: ${{ secrets.TLS_POSTGRES_DATABASE_URL }}
|
||||
TEST_INFO_STRIPE: ${{ secrets.TEST_INFO_STRIPE }}
|
||||
SHELLOPTS: igncr
|
||||
VERDACCIO_PORT: 4873
|
||||
run: |
|
||||
node packages/bun-internal-test/src/runner.node.mjs $(which bun)
|
||||
- if: ${{ always() }}
|
||||
|
||||
@@ -5,7 +5,6 @@ import { mkdtempSync, realpathSync } from "fs";
|
||||
import { rm, writeFile, mkdir, exists, cp } from "fs/promises";
|
||||
import { readdirSorted } from "../dummy.registry";
|
||||
import { tmpdir } from "os";
|
||||
import { fork, ChildProcess } from "child_process";
|
||||
import { beforeAll, afterAll, beforeEach, afterEach, test, expect, describe } from "bun:test";
|
||||
|
||||
expect.extend({
|
||||
@@ -13,32 +12,9 @@ expect.extend({
|
||||
toHaveBins,
|
||||
});
|
||||
|
||||
var verdaccioServer: ChildProcess;
|
||||
var testCounter: number = 0;
|
||||
var port: number = 4873;
|
||||
var packageDir: string;
|
||||
|
||||
beforeAll(async () => {
|
||||
verdaccioServer = fork(
|
||||
require.resolve("verdaccio/bin/verdaccio"),
|
||||
["-c", join(import.meta.dir, "verdaccio.yaml"), "-l", `${port}`],
|
||||
{ silent: true, execPath: "bun" },
|
||||
);
|
||||
|
||||
await new Promise<void>(done => {
|
||||
verdaccioServer.on("message", (msg: { verdaccio_started: boolean }) => {
|
||||
if (msg.verdaccio_started) {
|
||||
console.log("Verdaccio started");
|
||||
done();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
verdaccioServer.kill();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
packageDir = mkdtempSync(join(realpathSync(tmpdir()), "bun-install-registry-" + testCounter++ + "-"));
|
||||
env.BUN_INSTALL_CACHE_DIR = join(packageDir, ".bun-cache");
|
||||
@@ -48,7 +24,7 @@ beforeEach(async () => {
|
||||
`
|
||||
[install]
|
||||
cache = false
|
||||
registry = "http://localhost:${port}/"
|
||||
registry = "http://localhost:${env.VERDACCIO_PORT}/"
|
||||
`,
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user