From 31967b76965ce7e19a8e1856b38f77650a265edf Mon Sep 17 00:00:00 2001 From: Replit user <> Date: Wed, 24 Jan 2024 13:56:31 +0000 Subject: [PATCH] try to fix test issue on linux ci --- .gitignore | 1 + .replit | 17 +++++++++++++++++ bun.lockb | Bin 20515 -> 20997 bytes index.js | 14 ++++++++++++++ index.test.ts | 28 +++++++++++----------------- replit.nix | 3 +++ 6 files changed, 46 insertions(+), 17 deletions(-) create mode 100644 .replit create mode 100644 replit.nix diff --git a/.gitignore b/.gitignore index a2b5be1..00ed0f8 100644 --- a/.gitignore +++ b/.gitignore @@ -185,6 +185,7 @@ $RECYCLE.BIN/ /target Cargo.lock +.cargo/ .pnp.* .yarn/* diff --git a/.replit b/.replit new file mode 100644 index 0000000..7ce2db0 --- /dev/null +++ b/.replit @@ -0,0 +1,17 @@ +run = "bun run build:debug && bun test" +modules = ["bun-1.0:v17-20240117-0bd73cd", "nodejs-20:v24-20240117-0bd73cd", "rust-stable:v4-20240117-0bd73cd"] + +disableGuessImports = true +disableInstallBeforeRun = true + +[nix] +channel = "stable-23_11" + +[rules] + +[rules.formatter] + +[rules.formatter.fileExtensions] + +[rules.formatter.fileExtensions.".ts"] +id = "module:nodejs-20:v24-20240117-0bd73cd/formatter:prettier" diff --git a/bun.lockb b/bun.lockb index 00f7cc9431114f577e10d3dc978ca9e6e33bc755..488a467c238464b1bfb53a0b6d83086c9603941b 100755 GIT binary patch delta 3459 zcmd5qMC3zojH5%xgY18`dBYX)BY8$B~Ls&(sr`*;NOnD8#y$4^w8bi$N%`V z)9?PguXqpG|pv8N3pD!NkaA+Eh^d*OV4-6!GZ6)Q- zwDN7>S(xv@CMsW+nRenq@P&|bz>C3)T$)x2ei`c*fjhCD#@D*j`zFAPAP)~Dhx>4V zR>;shmg*WxcJ~Zx+5xymL!W@tp*RG38^yvx@SDJ?u)8lguo()jb=)@a-wxn{_xac# z24vK`5WHNAXsIiJi3To$6V8>e&IOa;bmWXRf0qS+4fvwT<@yojzVJ=Oc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46F0r2NmJu`~;UG;GUv zt;ur#5jHTA?QQxrvHO_9yW^z2EzufWxraz=fTBaEO^uG7fDjeWG5N(UwH?%Ei8Kc%F2iGTS2In$}+d!#4f5c zvfYiA`wzUp;^f6|jT_ht-G*FnjyN*pMy$PI`Poe(&oy2&=0EH1di1%4zumZ>ej?Cu z6l+8>-rt70F5b*kB;*+{YQ0k=`@E!exJZ8Yk}>~nSF!rYWw&?CyOe&8sh3=_MdYUT zvY7w;d%x}b9hiS0r`m}0o6^dwY9oY;+f7&+QUtG@y-k6;*P1s?dv+%uIgH! VSht~f?fUBm-{_b#K^B~L{~wn`;PwCj diff --git a/index.js b/index.js index a63da8c..1481fc1 100644 --- a/index.js +++ b/index.js @@ -266,6 +266,20 @@ switch (platform) { } } break + case 's390x': + localFileExisted = existsSync( + join(__dirname, 'ruspty.linux-s390x-gnu.node') + ) + try { + if (localFileExisted) { + nativeBinding = require('./ruspty.linux-s390x-gnu.node') + } else { + nativeBinding = require('@replit/ruspty-linux-s390x-gnu') + } + } catch (e) { + loadError = e + } + break default: throw new Error(`Unsupported architecture on Linux: ${arch}`) } diff --git a/index.test.ts b/index.test.ts index e32a484..26fb335 100644 --- a/index.test.ts +++ b/index.test.ts @@ -17,7 +17,7 @@ describe("PTY", () => { expect(err).toBeNull(); expect(exitCode).toBe(0); done(); - } + }, ); const readStream = fs.createReadStream("", { fd: pty.fd }); @@ -38,7 +38,7 @@ describe("PTY", () => { expect(err).toBeNull(); expect(exitCode).toBe(17); done(); - } + }, ); }); @@ -85,19 +85,12 @@ describe("PTY", () => { writeStream.write("stty size; echo 'done1'\n"); }); - test.skip("respects working directory", (done) => { - const pty = new Pty( - "/bin/pwd", - [], - {}, - CWD, - [80, 24], - (err, exitCode) => { - expect(err).toBeNull(); - expect(exitCode).toBe(0); - done(); - } - ); + test("respects working directory", (done) => { + const pty = new Pty("/bin/pwd", [], {}, CWD, [80, 24], (err, exitCode) => { + expect(err).toBeNull(); + expect(exitCode).toBe(0); + done(); + }); const readStream = fs.createReadStream("", { fd: pty.fd }); @@ -112,7 +105,7 @@ describe("PTY", () => { const pty = new Pty( "/bin/sh", - ["-c", "echo $ENV_VARIABLE; exit"], + ["-c", "sleep 0.1s && echo $ENV_VARIABLE; exit"], { ENV_VARIABLE: message, }, @@ -122,8 +115,9 @@ describe("PTY", () => { expect(err).toBeNull(); expect(exitCode).toBe(0); expect(buffer).toBe(message + "\r\n"); + done(); - } + }, ); const readStream = fs.createReadStream("", { fd: pty.fd }); diff --git a/replit.nix b/replit.nix new file mode 100644 index 0000000..66babba --- /dev/null +++ b/replit.nix @@ -0,0 +1,3 @@ +{ pkgs }: { + deps = []; +} \ No newline at end of file