mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 03:48:56 +00:00
Do not skip tests in CI
This commit is contained in:
3
.github/workflows/bun-linux-build.yml
vendored
3
.github/workflows/bun-linux-build.yml
vendored
@@ -4,6 +4,9 @@ concurrency:
|
||||
group: bun-linux-build-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
BUN_CI: 1
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
|
||||
2
.github/workflows/bun-mac-aarch64.yml
vendored
2
.github/workflows/bun-mac-aarch64.yml
vendored
@@ -7,7 +7,7 @@ concurrency:
|
||||
env:
|
||||
LLVM_VERSION: 16
|
||||
BUN_DOWNLOAD_URL_BASE: https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/latest
|
||||
|
||||
BUN_CI: 1
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
2
.github/workflows/bun-mac-x64-baseline.yml
vendored
2
.github/workflows/bun-mac-x64-baseline.yml
vendored
@@ -7,7 +7,7 @@ concurrency:
|
||||
env:
|
||||
LLVM_VERSION: 16
|
||||
BUN_DOWNLOAD_URL_BASE: https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/latest
|
||||
|
||||
BUN_CI: 1
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
2
.github/workflows/bun-mac-x64.yml
vendored
2
.github/workflows/bun-mac-x64.yml
vendored
@@ -7,7 +7,7 @@ concurrency:
|
||||
env:
|
||||
LLVM_VERSION: 16
|
||||
BUN_DOWNLOAD_URL_BASE: https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/latest
|
||||
|
||||
BUN_CI: 1
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
2
.github/workflows/format.yml
vendored
2
.github/workflows/format.yml
vendored
@@ -12,7 +12,7 @@ on:
|
||||
|
||||
env:
|
||||
ZIG_VERSION: 0.12.0-dev.1828+225fe6ddb
|
||||
|
||||
BUN_CI: 1
|
||||
jobs:
|
||||
format:
|
||||
name: format
|
||||
|
||||
@@ -9,6 +9,7 @@ export const isLinux = process.platform === "linux";
|
||||
export const isPosix = isMacOS || isLinux;
|
||||
export const isWindows = process.platform === "win32";
|
||||
export const isIntelMacOS = isMacOS && process.arch === "x64";
|
||||
export const isBunCI = process.env.BUN_CI === "1";
|
||||
|
||||
export const bunEnv: NodeJS.ProcessEnv = {
|
||||
...process.env,
|
||||
@@ -21,6 +22,8 @@ export const bunEnv: NodeJS.ProcessEnv = {
|
||||
BUN_RUNTIME_TRANSPILER_CACHE_PATH: "0",
|
||||
};
|
||||
|
||||
delete bunEnv.BUN_CI;
|
||||
|
||||
if (isWindows) {
|
||||
bunEnv.SHELLOPTS = "igncr"; // Ignore carriage return
|
||||
}
|
||||
@@ -389,16 +392,24 @@ export async function describeWithContainer(
|
||||
fn: (port: number) => void,
|
||||
) {
|
||||
describe(label, () => {
|
||||
const docker = dockerExe();
|
||||
if (!docker) {
|
||||
test.skip(`docker is not installed, skipped: ${image}`, () => {});
|
||||
return;
|
||||
}
|
||||
const { arch, platform } = process;
|
||||
if ((archs && !archs?.includes(arch)) || platform === "win32") {
|
||||
test.skip(`docker image is not supported on ${platform}/${arch}, skipped: ${image}`, () => {});
|
||||
return false;
|
||||
}
|
||||
|
||||
const docker = dockerExe();
|
||||
if (!docker) {
|
||||
if (isBunCI) {
|
||||
test(label, () => {
|
||||
throw new Error("Docker is not installed on CI but is required for this test");
|
||||
});
|
||||
return;
|
||||
}
|
||||
test.skip(`docker is not installed, skipped: ${image}`, () => {});
|
||||
return;
|
||||
}
|
||||
|
||||
let containerId: string;
|
||||
{
|
||||
const envs = Object.entries(env).map(([k, v]) => `-e${k}=${v}`);
|
||||
|
||||
3
test/js/third_party/mongodb/mongodb.test.ts
vendored
3
test/js/third_party/mongodb/mongodb.test.ts
vendored
@@ -1,9 +1,10 @@
|
||||
import { test, expect, describe } from "bun:test";
|
||||
import { isBunCI } from "harness";
|
||||
import { MongoClient } from "mongodb";
|
||||
|
||||
const CONNECTION_STRING = process.env.TLS_MONGODB_DATABASE_URL;
|
||||
|
||||
const it = CONNECTION_STRING ? test : test.skip;
|
||||
const it = CONNECTION_STRING ? test : test.skipIf(!isBunCI);
|
||||
|
||||
describe("mongodb", () => {
|
||||
it("should connect and inpect", async () => {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { test, expect, describe } from "bun:test";
|
||||
import { bunRun } from "harness";
|
||||
import { bunRun, isBunCI } from "harness";
|
||||
import path from "path";
|
||||
|
||||
const it = process.env.SMTP_SENDGRID_KEY && process.env.SMTP_SENDGRID_SENDER ? test : test.skip;
|
||||
const it = process.env.SMTP_SENDGRID_KEY && process.env.SMTP_SENDGRID_SENDER ? test : test.skipIf(!isBunCI);
|
||||
describe("nodemailer", () => {
|
||||
it("basic smtp", async () => {
|
||||
try {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { test, expect, describe } from "bun:test";
|
||||
import { isBunCI } from "harness";
|
||||
import { Pool, Client } from "pg";
|
||||
import { parse } from "pg-connection-string";
|
||||
import postgres from "postgres";
|
||||
|
||||
const CONNECTION_STRING = process.env.TLS_POSTGRES_DATABASE_URL;
|
||||
|
||||
const it = CONNECTION_STRING ? test : test.skip;
|
||||
const it = CONNECTION_STRING ? test : test.skipIf(!isBunCI);
|
||||
|
||||
describe("pg", () => {
|
||||
it("should connect using TLS", async () => {
|
||||
|
||||
Reference in New Issue
Block a user