Compare commits

...

1 Commits

Author SHA1 Message Date
Meghan Denny
91191a0ab5 ci: add axios to vendor tests 2025-10-21 12:36:38 -07:00
3 changed files with 23 additions and 5 deletions

View File

@@ -16,6 +16,7 @@ jobs:
matrix:
package:
- elysia
- axios
steps:
- uses: actions/checkout@v4

View File

@@ -492,7 +492,7 @@ async function runTests() {
if (isBuildkite) {
// Group flaky tests together, regardless of the title
const context = flaky ? "flaky" : title;
const style = flaky || title.startsWith("vendor") ? "warning" : "error";
const style = flaky ? "warning" : "error";
if (!flaky) attempt = 1; // no need to show the retries count on failures, we know it maxed out
if (title.startsWith("vendor")) {
@@ -644,7 +644,7 @@ async function runTests() {
}
if (vendorTests?.length) {
for (const { cwd: vendorPath, packageManager, testRunner, testPaths } of vendorTests) {
for (const { cwd: vendorPath, packageManager, testRunner, testPaths, build } of vendorTests) {
if (!testPaths.length) {
continue;
}
@@ -659,13 +659,12 @@ async function runTests() {
throw new Error(`Unsupported package manager: ${packageManager}`);
}
// build
const buildResult = await spawnBun(execPath, {
cwd: vendorPath,
args: ["run", "build"],
timeout: 60_000,
});
if (!buildResult.ok) {
if (build && !buildResult.ok) {
throw new Error(`Failed to build vendor: ${buildResult.error}`);
}
@@ -1660,6 +1659,7 @@ function getTests(cwd) {
* @property {string} [testRunner]
* @property {string[]} [testExtensions]
* @property {boolean | Record<string, boolean | string>} [skipTests]
* @property {boolean} [build]
*/
/**
@@ -1668,6 +1668,7 @@ function getTests(cwd) {
* @property {string} packageManager
* @property {string} testRunner
* @property {string[]} testPaths
* @property {boolean} build
*/
/**
@@ -1702,7 +1703,17 @@ async function getVendorTests(cwd) {
return Promise.all(
relevantVendors.map(
async ({ package: name, repository, tag, testPath, testExtensions, testRunner, packageManager, skipTests }) => {
async ({
package: name,
repository,
tag,
testPath,
testExtensions,
testRunner,
packageManager,
skipTests,
build,
}) => {
const vendorPath = join(cwd, "vendor", name);
if (!existsSync(vendorPath)) {
@@ -1779,6 +1790,7 @@ async function getVendorTests(cwd) {
packageManager: packageManager || "bun",
testRunner: testRunner || "bun",
testPaths,
build: build ?? true,
};
},
),

View File

@@ -3,5 +3,10 @@
"package": "elysia",
"repository": "https://github.com/elysiajs/elysia",
"tag": "1.4.12"
},
{
"package": "axios",
"repository": "https://github.com/axios/axios",
"tag": "v1.12.2"
}
]