1
1
import { spawnSync , spawn , Glob } from "bun" ;
2
2
import { beforeAll , describe , expect , it } from "bun:test" ;
3
- import { bunEnv , bunExe , isCI , isMusl } from "harness" ;
3
+ import { bunEnv , bunExe , isBroken , isCI , isIntelMacOS , isMusl } from "harness" ;
4
4
import { join , dirname } from "path" ;
5
5
import os from "node:os" ;
6
6
@@ -11,12 +11,18 @@ const jsNativeApiTests = Array.from(new Glob("**/*.js").scanSync(jsNativeApiRoot
11
11
const nodeApiTests = Array . from ( new Glob ( "**/*.js" ) . scanSync ( nodeApiRoot ) ) ;
12
12
13
13
// These js-native-api tests are known to fail and will be fixed in later PRs
14
- let failingJsNativeApiTests = [
14
+ let failingJsNativeApiTests : string [ ] = [
15
15
// We skip certain parts of test_string/test.js because we don't support creating empty external
16
16
// strings. We don't skip the entire thing because the other tests are useful to check.
17
17
// "test_string/test.js",
18
18
] ;
19
19
20
+ if ( isBroken && isIntelMacOS ) {
21
+ // TODO(@190n)
22
+ // these are flaky on Intel Mac
23
+ failingJsNativeApiTests . push ( "test_reference_by_node_api_version/test.js" , "test_reference/test.js" ) ;
24
+ }
25
+
20
26
// These are the tests from node-api that failed as of commit 83f536f4d, except for those that
21
27
// passed in Bun v1.1.34. It'll take some time to get all these to work, as we've been focusing more
22
28
// on js-native-api tests so far, and we don't want these tests to pollute CI. But we do want to
@@ -94,7 +100,9 @@ beforeAll(async () => {
94
100
await child . exited ;
95
101
if ( child . exitCode !== 0 ) {
96
102
const stderr = await new Response ( child . stderr ) . text ( ) ;
97
- throw new Error ( `node-gyp rebuild in ${ dir } failed:\n${ stderr } ` ) ;
103
+ console . error ( `node-gyp rebuild in ${ dir } failed:\n${ stderr } ` ) ;
104
+ console . error ( "bailing out!" ) ;
105
+ process . exit ( 1 ) ;
98
106
}
99
107
}
100
108
@@ -106,7 +114,7 @@ beforeAll(async () => {
106
114
}
107
115
108
116
const parallelism = Math . min ( 8 , os . cpus ( ) . length , 1 /* TODO(@heimskr): remove */ ) ;
109
- const jobs = [ ] ;
117
+ const jobs : Promise < void > [ ] = [ ] ;
110
118
for ( let i = 0 ; i < parallelism ; i ++ ) {
111
119
jobs . push ( worker ( ) ) ;
112
120
}
0 commit comments