From ff1be98c8a82911c11daf81168ad74b50ab55ef3 Mon Sep 17 00:00:00 2001 From: SnorlaxAssist <57375992+SnorlaxAssist@users.noreply.github.com> Date: Wed, 20 Sep 2023 15:41:49 -0400 Subject: [PATCH 01/15] Update options.rs Using windows powershell as the shell executor. --- src/lune/builtins/process/options.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lune/builtins/process/options.rs b/src/lune/builtins/process/options.rs index 688caa37..21a62640 100644 --- a/src/lune/builtins/process/options.rs +++ b/src/lune/builtins/process/options.rs @@ -98,7 +98,7 @@ impl<'lua> FromLua<'lua> for ProcessSpawnOptions { LuaValue::Boolean(true) => { this.shell = match env::consts::FAMILY { "unix" => Some("/bin/sh".to_string()), - "windows" => Some("/bin/sh".to_string()), + "windows" => Some("powershell".to_string()), _ => None, }; } From f7ada851008df5c88f7a2fd46b72347679d5f080 Mon Sep 17 00:00:00 2001 From: SnorlaxAssist <57375992+SnorlaxAssist@users.noreply.github.com> Date: Wed, 20 Sep 2023 17:04:30 -0400 Subject: [PATCH 02/15] Update spawn.luau Made changes to the commands and params to support windows equivalents. --- tests/process/spawn.luau | 63 +++++++++++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 17 deletions(-) diff --git a/tests/process/spawn.luau b/tests/process/spawn.luau index c3537dfb..6cae260c 100644 --- a/tests/process/spawn.luau +++ b/tests/process/spawn.luau @@ -10,9 +10,17 @@ local thread = task.delay(1, function() process.exit(1) end) -local result = process.spawn("ls", { - "-a", -}) +local isWindows = process.os == "windows"; + +-- To run windows command, needs to launch cmd.exe +local result = process.spawn( + if isWindows then "cmd" else "ls", + if isWindows then { + "/c", "dir" + } else { + "-a" + } +) task.cancel(thread) @@ -27,7 +35,7 @@ assert(string.find(result.stdout, ".gitignore") ~= nil, "Missing .gitignore in o -- It should also work the same when spawned using a shell local shellResult = process.spawn("ls", { - "-a", + if isWindows then "-Force" else "-a" }, { shell = true, }) @@ -40,30 +48,34 @@ assert(shellResult.stdout ~= "", "Stdout was empty (shell)") assert(string.find(shellResult.stdout, "Cargo.toml") ~= nil, "Missing Cargo.toml in output (shell)") assert(string.find(shellResult.stdout, ".gitignore") ~= nil, "Missing .gitignore in output (shell)") +local pwdCommand = if isWindows then "cmd" else "pwd" +local pwdArgs = if isWindows then { "/c", "cd" } else {} -- Make sure the cwd option actually uses the directory we want -local rootPwd = process.spawn("pwd", {}, { +local rootPwd = process.spawn(pwdCommand, pwdArgs, { cwd = "/", }).stdout rootPwd = string.gsub(rootPwd, "^%s+", "") rootPwd = string.gsub(rootPwd, "%s+$", "") -if rootPwd ~= "/" then +-- Windows: C:\, Unix: / +local expectedRootPwd = if isWindows then string.sub(rootPwd, 1, 1) .. ":\\" else "/" +if rootPwd ~= expectedRootPwd then error( string.format( "Current working directory for child process was not set correctly!" - .. "\nExpected '/', got '%s'", - rootPwd + .. "\nExpected '%s', got '%s'", + expectedRootPwd, rootPwd ) ) end -- Setting cwd should not change the cwd of this process -local pwdBefore = process.spawn("pwd").stdout +local pwdBefore = process.spawn(pwdCommand, pwdArgs).stdout process.spawn("ls", {}, { cwd = "/", shell = true, }) -local pwdAfter = process.spawn("pwd").stdout +local pwdAfter = process.spawn(pwdCommand, pwdArgs).stdout assert(pwdBefore == pwdAfter, "Current working directory changed after running child process") --[[ @@ -74,7 +86,10 @@ assert(pwdBefore == pwdAfter, "Current working directory changed after running c local homeDir1 = process.spawn("echo $HOME", nil, { shell = true, }).stdout -local homeDir2 = process.spawn("pwd", nil, { + +-- Powershell for windows uses `$pwd.Path` instead of `pwd` as pwd would return a PathInfo object, +-- using $pwd.Path gets the Path property of the PathInfo object. +local homeDir2 = process.spawn(if isWindows then "$pwd.Path" else "pwd", nil, { shell = true, cwd = "~", }).stdout @@ -91,10 +106,17 @@ assert(homeDir1 == homeDir2, "Home dirs did not match when performing tilde subs than a single sleep but also less than 1.5 sleeps ]] +-- We need to account for the time it takes to spawn a process, because of Windows +local commandExecutionTolarance = 0 do + local commandExecutionStart = os.clock() + process.spawn("sleep", {"0"}, if isWindows then { shell = true } else nil) + commandExecutionTolarance = os.clock() - commandExecutionStart +end + local SLEEP_DURATION = 1 / 4 local SLEEP_SAMPLES = 2 -local thread2 = task.delay(SLEEP_DURATION * 1.5, function() +local thread2 = task.delay(commandExecutionTolarance + (SLEEP_DURATION * 1.5), function() stdio.ewrite("Spawning a sleep process should take a reasonable amount of time\n") task.wait(1) process.exit(1) @@ -104,7 +126,12 @@ local sleepStart = os.clock() local sleepCounter = 0 for i = 1, SLEEP_SAMPLES, 1 do task.spawn(function() - process.spawn("sleep", { tostring(SLEEP_DURATION) }) + -- Windows does not have a sleep command, so we use shell instead. + process.spawn("sleep", { + -- Sleep command on Windows in Seconds has some weird behavior with decimals. + if isWindows then "-Milliseconds" else nil::any, + tostring(SLEEP_DURATION * (isWindows and 1000 or 1)) + }, if isWindows then { shell = true } else nil) sleepCounter += 1 end) end @@ -114,7 +141,7 @@ end task.cancel(thread2) -local sleepElapsed = os.clock() - sleepStart +local sleepElapsed = (os.clock() - sleepStart) - commandExecutionTolarance assert( sleepElapsed >= SLEEP_DURATION, "Spawning a process that does blocking sleep did not sleep enough" @@ -128,13 +155,15 @@ assert( local echoMessage = "Hello from child process!" local echoResult = process.spawn("echo", { - '"$TEST_VAR"', + if isWindows then '"$Env:TEST_VAR"' else '"$TEST_VAR"', }, { env = { TEST_VAR = echoMessage }, - shell = "bash", + shell = if isWindows then true else "bash", -- Windows needs a default shell, bash does not exist on Windows stdio = "inherit", }) + +local trailingAddition = if isWindows then "\r\n" else "\n" assert( - echoResult.stdout == (echoMessage .. "\n"), -- Note that echo adds a newline + echoResult.stdout == (echoMessage .. trailingAddition), -- Note that echo adds a newline "Inheriting stdio did not return proper output" ) From 05bb1e02ff7c941e63a5e8e8de989391628a1e6a Mon Sep 17 00:00:00 2001 From: SnorlaxAssist <57375992+SnorlaxAssist@users.noreply.github.com> Date: Wed, 20 Sep 2023 18:05:20 -0400 Subject: [PATCH 03/15] Update spawn.luau Execution Tolerance time only for windows --- tests/process/spawn.luau | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/process/spawn.luau b/tests/process/spawn.luau index 6cae260c..cfca5a90 100644 --- a/tests/process/spawn.luau +++ b/tests/process/spawn.luau @@ -106,11 +106,13 @@ assert(homeDir1 == homeDir2, "Home dirs did not match when performing tilde subs than a single sleep but also less than 1.5 sleeps ]] --- We need to account for the time it takes to spawn a process, because of Windows +-- We need to account for the time it takes to spawn a process for Windows local commandExecutionTolarance = 0 do - local commandExecutionStart = os.clock() - process.spawn("sleep", {"0"}, if isWindows then { shell = true } else nil) - commandExecutionTolarance = os.clock() - commandExecutionStart + if isWindows then + local commandExecutionStart = os.clock() + process.spawn("sleep", {"0"}, if isWindows then { shell = true } else nil) + commandExecutionTolarance = os.clock() - commandExecutionStart + end end local SLEEP_DURATION = 1 / 4 From a5e4fdebe545892a4ca1ed8c5cd6a50f5b14e13d Mon Sep 17 00:00:00 2001 From: SnorlaxAssist <57375992+SnorlaxAssist@users.noreply.github.com> Date: Wed, 20 Sep 2023 18:15:44 -0400 Subject: [PATCH 04/15] Update spawn.luau Fixed args being different for linux and macOs for sleep test --- tests/process/spawn.luau | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/process/spawn.luau b/tests/process/spawn.luau index cfca5a90..f5f3b023 100644 --- a/tests/process/spawn.luau +++ b/tests/process/spawn.luau @@ -106,13 +106,11 @@ assert(homeDir1 == homeDir2, "Home dirs did not match when performing tilde subs than a single sleep but also less than 1.5 sleeps ]] --- We need to account for the time it takes to spawn a process for Windows +-- We need to account for the time it takes to spawn a process, because of Windows local commandExecutionTolarance = 0 do - if isWindows then - local commandExecutionStart = os.clock() - process.spawn("sleep", {"0"}, if isWindows then { shell = true } else nil) - commandExecutionTolarance = os.clock() - commandExecutionStart - end + local commandExecutionStart = os.clock() + process.spawn("sleep", {"0"}, if isWindows then { shell = true } else nil) + commandExecutionTolarance = os.clock() - commandExecutionStart end local SLEEP_DURATION = 1 / 4 @@ -129,11 +127,14 @@ local sleepCounter = 0 for i = 1, SLEEP_SAMPLES, 1 do task.spawn(function() -- Windows does not have a sleep command, so we use shell instead. - process.spawn("sleep", { - -- Sleep command on Windows in Seconds has some weird behavior with decimals. - if isWindows then "-Milliseconds" else nil::any, + local args = { tostring(SLEEP_DURATION * (isWindows and 1000 or 1)) - }, if isWindows then { shell = true } else nil) + }; + if isWindows then + -- Sleep command on Windows in Seconds has some weird behavior with decimals. + table.insert(args, 1, "-Milliseconds"); + end + process.spawn("sleep", args, if isWindows then { shell = true } else nil) sleepCounter += 1 end) end From d769f8f6a573b5a438e94c67d229b09324ea6c89 Mon Sep 17 00:00:00 2001 From: SnorlaxAssist <57375992+SnorlaxAssist@users.noreply.github.com> Date: Wed, 20 Sep 2023 18:36:18 -0400 Subject: [PATCH 05/15] Update spawn.luau Added and changed a few comments. --- tests/process/spawn.luau | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/process/spawn.luau b/tests/process/spawn.luau index f5f3b023..a82d495a 100644 --- a/tests/process/spawn.luau +++ b/tests/process/spawn.luau @@ -12,7 +12,7 @@ end) local isWindows = process.os == "windows"; --- To run windows command, needs to launch cmd.exe +-- To run windows command, we need to launch cmd.exe and pass the command as an argument. local result = process.spawn( if isWindows then "cmd" else "ls", if isWindows then { @@ -56,7 +56,7 @@ local rootPwd = process.spawn(pwdCommand, pwdArgs, { }).stdout rootPwd = string.gsub(rootPwd, "^%s+", "") rootPwd = string.gsub(rootPwd, "%s+$", "") --- Windows: C:\, Unix: / +-- Windows: :\, Unix: / local expectedRootPwd = if isWindows then string.sub(rootPwd, 1, 1) .. ":\\" else "/" if rootPwd ~= expectedRootPwd then error( @@ -106,7 +106,9 @@ assert(homeDir1 == homeDir2, "Home dirs did not match when performing tilde subs than a single sleep but also less than 1.5 sleeps ]] --- We need to account for the time it takes to spawn a process, because of Windows +-- We need to account for the time it takes to spawn a process, +-- due to Windows having a delay in launching processes. +-- Windows delay is likely caused by Windows Defender. local commandExecutionTolarance = 0 do local commandExecutionStart = os.clock() process.spawn("sleep", {"0"}, if isWindows then { shell = true } else nil) @@ -126,14 +128,15 @@ local sleepStart = os.clock() local sleepCounter = 0 for i = 1, SLEEP_SAMPLES, 1 do task.spawn(function() - -- Windows does not have a sleep command, so we use shell instead. local args = { + -- Sleep command on Windows in Seconds has some weird behavior with decimals... tostring(SLEEP_DURATION * (isWindows and 1000 or 1)) }; if isWindows then - -- Sleep command on Windows in Seconds has some weird behavior with decimals. + -- ... so we use milliseconds instead. table.insert(args, 1, "-Milliseconds"); end + -- Windows does not have `sleep` as a process, so we use powershell instead. process.spawn("sleep", args, if isWindows then { shell = true } else nil) sleepCounter += 1 end) @@ -161,10 +164,11 @@ local echoResult = process.spawn("echo", { if isWindows then '"$Env:TEST_VAR"' else '"$TEST_VAR"', }, { env = { TEST_VAR = echoMessage }, - shell = if isWindows then true else "bash", -- Windows needs a default shell, bash does not exist on Windows + shell = if isWindows then true else "bash", -- bash does not exist on Windows, using default shell option instead. stdio = "inherit", }) +-- Windows echo adds a \r before the newline local trailingAddition = if isWindows then "\r\n" else "\n" assert( echoResult.stdout == (echoMessage .. trailingAddition), -- Note that echo adds a newline From b40f8e41da22c029e87951b2544f53a0755a0068 Mon Sep 17 00:00:00 2001 From: SnorlaxAssist <57375992+SnorlaxAssist@users.noreply.github.com> Date: Wed, 20 Sep 2023 18:52:06 -0400 Subject: [PATCH 06/15] Update requests.luau Connection refusal fix for Windows --- tests/net/serve/requests.luau | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/net/serve/requests.luau b/tests/net/serve/requests.luau index 1d033a12..b17ad2d1 100644 --- a/tests/net/serve/requests.luau +++ b/tests/net/serve/requests.luau @@ -52,7 +52,8 @@ if not success then assert( string.find(message, "Connection reset") or string.find(message, "Connection closed") - or string.find(message, "Connection refused"), + or string.find(message, "Connection refused") + or string.find(message, "No connection could be made"), -- Windows Request Error "Server did not stop responding to requests" ) else From 4af80f8c11392c1bd3033e2eb42f4778527dd449 Mon Sep 17 00:00:00 2001 From: SnorlaxAssist <57375992+SnorlaxAssist@users.noreply.github.com> Date: Wed, 20 Sep 2023 19:32:23 -0400 Subject: [PATCH 07/15] Update spawn.luau Command Execution Tolarance is now only dedicated for windows. Adjusted yield time with Command Execution Tolarance --- tests/process/spawn.luau | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/process/spawn.luau b/tests/process/spawn.luau index a82d495a..36cf469d 100644 --- a/tests/process/spawn.luau +++ b/tests/process/spawn.luau @@ -109,16 +109,19 @@ assert(homeDir1 == homeDir2, "Home dirs did not match when performing tilde subs -- We need to account for the time it takes to spawn a process, -- due to Windows having a delay in launching processes. -- Windows delay is likely caused by Windows Defender. -local commandExecutionTolarance = 0 do - local commandExecutionStart = os.clock() - process.spawn("sleep", {"0"}, if isWindows then { shell = true } else nil) - commandExecutionTolarance = os.clock() - commandExecutionStart +local win_commandExecutionTolarance = 0 do + if isWindows then + local commandExecutionStart = os.clock() + process.spawn("sleep", {"0"}, if isWindows then { shell = true } else nil) + win_commandExecutionTolarance = os.clock() - commandExecutionStart + end end local SLEEP_DURATION = 1 / 4 local SLEEP_SAMPLES = 2 -local thread2 = task.delay(commandExecutionTolarance + (SLEEP_DURATION * 1.5), function() +local yieldTolarance = win_commandExecutionTolarance + (SLEEP_DURATION * 1.5); +local thread2 = task.delay(yieldTolarance, function() stdio.ewrite("Spawning a sleep process should take a reasonable amount of time\n") task.wait(1) process.exit(1) @@ -147,13 +150,14 @@ end task.cancel(thread2) -local sleepElapsed = (os.clock() - sleepStart) - commandExecutionTolarance +local sleepElapsed = (os.clock() - sleepStart) - win_commandExecutionTolarance + assert( sleepElapsed >= SLEEP_DURATION, "Spawning a process that does blocking sleep did not sleep enough" ) assert( - sleepElapsed < SLEEP_DURATION * 1.5, + sleepElapsed < yieldTolarance, "Coroutine yielded the main lua thread during process yield" ) From b6d75e363cd7145d72da9f04abdbbac5666ee67b Mon Sep 17 00:00:00 2001 From: SnorlaxAssist <57375992+SnorlaxAssist@users.noreply.github.com> Date: Sun, 24 Sep 2023 17:53:38 -0400 Subject: [PATCH 08/15] Update ci.yaml Included MinGW installation from https://github.com/filiptibell/lune/pull/106#issuecomment-1724855649 --- .github/workflows/ci.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bfe2683b..8a6c1e08 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -60,6 +60,12 @@ jobs: components: clippy targets: ${{ matrix.cargo-target }} + - name: Set up MinGW + uses: egor-tensin/setup-mingw@v2 + with: + platform: x64 + if: ${{matrix.runner-os == 'windows-latest'}} + - name: Build run: | cargo build \ From cc24d820d36b11a42b24d20f64495ccc464e44a8 Mon Sep 17 00:00:00 2001 From: SnorlaxAssist Date: Sun, 24 Sep 2023 19:07:03 -0400 Subject: [PATCH 09/15] Serde Update - This reverts commit 1cf7e9b7fd01cae1184374f6a0c2c44ca982f01d. - Added test serde file to convert CRLF to LF on windows. --- .github/workflows/ci.yaml | 6 ------ tests/serde/compression/files.luau | 7 +++++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8a6c1e08..bfe2683b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -60,12 +60,6 @@ jobs: components: clippy targets: ${{ matrix.cargo-target }} - - name: Set up MinGW - uses: egor-tensin/setup-mingw@v2 - with: - platform: x64 - if: ${{matrix.runner-os == 'windows-latest'}} - - name: Build run: | cargo build \ diff --git a/tests/serde/compression/files.luau b/tests/serde/compression/files.luau index 8d41492e..71266f95 100644 --- a/tests/serde/compression/files.luau +++ b/tests/serde/compression/files.luau @@ -9,6 +9,8 @@ type Test = { Target: string, } +local isWindows = process.os == "windows"; + local TESTS: { Test } = { { Format = "brotli", @@ -37,6 +39,11 @@ for _, test in TESTS do local source = fs.readFile(test.Source) local target = fs.readFile(test.Target) + if isWindows then + -- Windows: CRLF -> LF + source = string.gsub(source, "\r\n", "\n", #source - 2); + end + local success, compressed = pcall(serde.compress, test.Format, source) if not success then stdio.ewrite( From 8aeeac0a5f11b082c8f188fb0e860ad888c36754 Mon Sep 17 00:00:00 2001 From: SnorlaxAssist <57375992+SnorlaxAssist@users.noreply.github.com> Date: Mon, 25 Sep 2023 11:19:08 -0400 Subject: [PATCH 10/15] Update spawn.luau explicit "powershell" instead of `true` --- tests/process/spawn.luau | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/process/spawn.luau b/tests/process/spawn.luau index 36cf469d..3530f653 100644 --- a/tests/process/spawn.luau +++ b/tests/process/spawn.luau @@ -168,7 +168,7 @@ local echoResult = process.spawn("echo", { if isWindows then '"$Env:TEST_VAR"' else '"$TEST_VAR"', }, { env = { TEST_VAR = echoMessage }, - shell = if isWindows then true else "bash", -- bash does not exist on Windows, using default shell option instead. + shell = if isWindows then "powershell" else "bash", -- "bash" does not exist on Windows, using "powershell" instead. stdio = "inherit", }) From c1b900341757aa9b882e26d4f9eecf45e5ac4add Mon Sep 17 00:00:00 2001 From: SnorlaxAssist <57375992+SnorlaxAssist@users.noreply.github.com> Date: Mon, 25 Sep 2023 12:12:48 -0400 Subject: [PATCH 11/15] Update spawn.luau Large static windows time tolerance --- tests/process/spawn.luau | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/tests/process/spawn.luau b/tests/process/spawn.luau index 3530f653..e19f328c 100644 --- a/tests/process/spawn.luau +++ b/tests/process/spawn.luau @@ -106,21 +106,12 @@ assert(homeDir1 == homeDir2, "Home dirs did not match when performing tilde subs than a single sleep but also less than 1.5 sleeps ]] --- We need to account for the time it takes to spawn a process, --- due to Windows having a delay in launching processes. --- Windows delay is likely caused by Windows Defender. -local win_commandExecutionTolarance = 0 do - if isWindows then - local commandExecutionStart = os.clock() - process.spawn("sleep", {"0"}, if isWindows then { shell = true } else nil) - win_commandExecutionTolarance = os.clock() - commandExecutionStart - end -end - local SLEEP_DURATION = 1 / 4 local SLEEP_SAMPLES = 2 -local yieldTolarance = win_commandExecutionTolarance + (SLEEP_DURATION * 1.5); +-- Windows tend to have a higher execution time +local yieldTolarance = if isWindows then 15 else SLEEP_DURATION * 1.5; + local thread2 = task.delay(yieldTolarance, function() stdio.ewrite("Spawning a sleep process should take a reasonable amount of time\n") task.wait(1) @@ -150,7 +141,7 @@ end task.cancel(thread2) -local sleepElapsed = (os.clock() - sleepStart) - win_commandExecutionTolarance +local sleepElapsed = os.clock() - sleepStart assert( sleepElapsed >= SLEEP_DURATION, From 79f01f424c99b892ce975411d254441cfbfd28be Mon Sep 17 00:00:00 2001 From: SnorlaxAssist <57375992+SnorlaxAssist@users.noreply.github.com> Date: Mon, 25 Sep 2023 12:17:16 -0400 Subject: [PATCH 12/15] Update .gitattributes --- .gitattributes | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitattributes b/.gitattributes index cf332f35..0b2679dc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,3 +7,6 @@ # Ensure all lua files use LF *.lua eol=lf *.luau eol=lf + +# Ensure all txt files within tests use LF +tests/*.txt eol=lf From c39b6d1794fada107b12a4db7c2692bb409aabc0 Mon Sep 17 00:00:00 2001 From: SnorlaxAssist Date: Mon, 25 Sep 2023 13:26:19 -0400 Subject: [PATCH 13/15] Update .gitattributes Path fix --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 0b2679dc..3efb2731 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,4 +9,4 @@ *.luau eol=lf # Ensure all txt files within tests use LF -tests/*.txt eol=lf +tests/**/*.txt eol=lf From a04eaf6c8b0a1ecaac7047feaa77f256b5f5ecf2 Mon Sep 17 00:00:00 2001 From: SnorlaxAssist Date: Mon, 25 Sep 2023 13:46:18 -0400 Subject: [PATCH 14/15] Serde & Spawn Update - Reverts the CRLF to LF conversion change from a commit in 1f9f683403c8bc498de714d9b168dee2dae082f5. - Increased the timeout time for windows from 15 -> 25 --- tests/process/spawn.luau | 2 +- tests/serde/compression/files.luau | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/tests/process/spawn.luau b/tests/process/spawn.luau index e19f328c..77154390 100644 --- a/tests/process/spawn.luau +++ b/tests/process/spawn.luau @@ -110,7 +110,7 @@ local SLEEP_DURATION = 1 / 4 local SLEEP_SAMPLES = 2 -- Windows tend to have a higher execution time -local yieldTolarance = if isWindows then 15 else SLEEP_DURATION * 1.5; +local yieldTolarance = if isWindows then 25 else SLEEP_DURATION * 1.5; local thread2 = task.delay(yieldTolarance, function() stdio.ewrite("Spawning a sleep process should take a reasonable amount of time\n") diff --git a/tests/serde/compression/files.luau b/tests/serde/compression/files.luau index 71266f95..e2f5ab4d 100644 --- a/tests/serde/compression/files.luau +++ b/tests/serde/compression/files.luau @@ -9,8 +9,6 @@ type Test = { Target: string, } -local isWindows = process.os == "windows"; - local TESTS: { Test } = { { Format = "brotli", @@ -39,11 +37,6 @@ for _, test in TESTS do local source = fs.readFile(test.Source) local target = fs.readFile(test.Target) - if isWindows then - -- Windows: CRLF -> LF - source = string.gsub(source, "\r\n", "\n", #source - 2); - end - local success, compressed = pcall(serde.compress, test.Format, source) if not success then stdio.ewrite( @@ -107,4 +100,4 @@ end if failed then process.exit(1) -end +end \ No newline at end of file From cb369f85eda9d260a37b3da608aa303bfcc56e3a Mon Sep 17 00:00:00 2001 From: SnorlaxAssist Date: Mon, 25 Sep 2023 14:08:36 -0400 Subject: [PATCH 15/15] Update files.luau CRLF to LF --- tests/serde/compression/files.luau | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/serde/compression/files.luau b/tests/serde/compression/files.luau index e2f5ab4d..8d41492e 100644 --- a/tests/serde/compression/files.luau +++ b/tests/serde/compression/files.luau @@ -100,4 +100,4 @@ end if failed then process.exit(1) -end \ No newline at end of file +end