Skip to content

Commit

Permalink
don't build rust code for browser-only tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ganthern authored and tuta-sudipg committed Jan 2, 2025
1 parent cda589a commit 546d8a8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion buildSrc/packageBuilderFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ export async function buildRuntimePackages() {
/**
* Build all packages in packages directory.
*/
export async function buildPackages(pathPrefix = ".") {
export async function buildPackages(pathPrefix = ".", exclude = []) {
const packages = await glob(`${pathPrefix}/packages/*`, { deep: 1, onlyDirectories: true })
for (const dir of packages) {
if (exclude.some((p) => dir.endsWith(p))) {
console.log(`skipping build for ${dir}`)
continue
}
if (process.platform === "win32") {
const before = process.cwd()
cd(dir)
Expand Down
4 changes: 2 additions & 2 deletions test/TestBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { buildPackages } from "../buildSrc/packageBuilderFunctions.js"
import { domainConfigs } from "../buildSrc/DomainConfigs.js"
import { sh } from "../buildSrc/sh.js"

export async function runTestBuild({ clean, fast = false }) {
export async function runTestBuild({ clean, fast = false, exclude = [] }) {
if (clean) {
await runStep("Clean", async () => {
await fs.emptyDir("build")
Expand All @@ -19,7 +19,7 @@ export async function runTestBuild({ clean, fast = false }) {

if (!fast) {
await runStep("Packages", async () => {
await buildPackages("..")
await buildPackages("..", exclude)
})

await runStep("Types", async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ await program
.addOption(new Option("-br, --browser", "Start the web server and run the tests in browser").default(false))
.addOption(new Option("--browser-cmd <path>", "Command used to run the browser").default("xdg-open"))
.action(async ({ clean, integration, filter, run, browser, browserCmd }) => {
await runTestBuild({ clean })
await runTestBuild({ clean, exclude: !run ? ["node-mimimi"] : [] })
console.log("build finished!")

let nodeOk
Expand Down

0 comments on commit 546d8a8

Please sign in to comment.