From 2fa2aa3c538b1723f8908f218cd60a2d8d409f07 Mon Sep 17 00:00:00 2001 From: Fyodor Soikin Date: Thu, 1 Aug 2024 15:35:22 -0400 Subject: [PATCH 01/18] Timeout in CI --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f23d5da..be5a61a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,4 +62,4 @@ jobs: run: npx spago build - name: Run tests - run: npx spago test + run: npx spago test --timeout 30 From 39dbeae4c95961e6153de041d1f8ab4a1e16b65d Mon Sep 17 00:00:00 2001 From: Fyodor Soikin Date: Thu, 1 Aug 2024 15:37:11 -0400 Subject: [PATCH 02/18] Timeout in CI --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be5a61a..909575d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,4 +62,4 @@ jobs: run: npx spago build - name: Run tests - run: npx spago test --timeout 30 + run: npx spago test -- --timeout 30 From f002704dd6d397a90eac2c0c5e0a1fdf0aea536d Mon Sep 17 00:00:00 2001 From: Fyodor Soikin Date: Thu, 1 Aug 2024 15:48:03 -0400 Subject: [PATCH 03/18] Wrong fixture --- test/Test/Main.purs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Test/Main.purs b/test/Test/Main.purs index a3df03a..4b93433 100644 --- a/test/Test/Main.purs +++ b/test/Test/Main.purs @@ -36,7 +36,7 @@ main = runSpecAndExitProcess [consoleReporter] $ runTest ["--example", "gotham city"] >>= shouldFailWith "filter-spaces.txt" Spec.it "can filter by FULL test name" do - runTest ["--example", "gotham city is a dark"] >>= shouldFailWith "filter-spaces.txt" + runTest ["--example", "gotham city is a dark"] >>= shouldFailWith "filter-full-name.txt" Spec.describe "--example-matches" do Spec.it "can filter by test name by regex" do From b18b823ffad76a6774b3b22eb5825d58810d7f23 Mon Sep 17 00:00:00 2001 From: Fyodor Soikin Date: Thu, 1 Aug 2024 16:20:55 -0400 Subject: [PATCH 04/18] Windows-friendly args --- .github/workflows/build.yml | 2 +- test/Test/Main.purs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 909575d..3a32896 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,4 +62,4 @@ jobs: run: npx spago build - name: Run tests - run: npx spago test -- --timeout 30 + run: npx spago test --backend-args "--timeout 30" diff --git a/test/Test/Main.purs b/test/Test/Main.purs index 4b93433..1dc8497 100644 --- a/test/Test/Main.purs +++ b/test/Test/Main.purs @@ -8,7 +8,6 @@ import Data.String (trim) import Data.String.Regex (replace) as Regex import Data.String.Regex.Flags (global) as Regex import Data.String.Regex.Unsafe (unsafeRegex) as Regex -import Debug (traceM) import Effect (Effect) import Node.ChildProcess.Types (Exit(..), pipe) import Node.Encoding (Encoding(..)) From abd270775462faa04b4c4940098aea47072a480f Mon Sep 17 00:00:00 2001 From: Fyodor Soikin Date: Thu, 1 Aug 2024 16:26:13 -0400 Subject: [PATCH 05/18] Windows-friendly args --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3a32896..42d2dd8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,4 +62,4 @@ jobs: run: npx spago build - name: Run tests - run: npx spago test --backend-args "--timeout 30" + run: npx spago test --backend-args --no-timeout From c34f72276e9260fc7fdf7763a33e2ff94f5f43f1 Mon Sep 17 00:00:00 2001 From: Fyodor Soikin Date: Thu, 1 Aug 2024 16:37:08 -0400 Subject: [PATCH 06/18] Debug --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 42d2dd8..ef4198a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,4 +62,4 @@ jobs: run: npx spago build - name: Run tests - run: npx spago test --backend-args --no-timeout + run: npx spago test -- "--timeout 30" From 09ce6b432103249d75e734c4eb03894c17ca13e5 Mon Sep 17 00:00:00 2001 From: Fyodor Soikin Date: Thu, 1 Aug 2024 16:47:10 -0400 Subject: [PATCH 07/18] Debug --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef4198a..84fc93f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,4 +62,9 @@ jobs: run: npx spago build - name: Run tests + if: matrix.os == 'windows-latest' run: npx spago test -- "--timeout 30" + + - name: Run tests + if: matrix.os != 'windows-latest' + run: npx spago test -- --timeout 30 From 0cf38bcd198eb702e3d000a9eabbdfcc33d8c4b8 Mon Sep 17 00:00:00 2001 From: Fyodor Soikin Date: Thu, 1 Aug 2024 16:51:00 -0400 Subject: [PATCH 08/18] Debug --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 84fc93f..632645b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,10 +61,10 @@ jobs: - name: Build the project run: npx spago build - - name: Run tests + - name: Run tests (Windows) if: matrix.os == 'windows-latest' run: npx spago test -- "--timeout 30" - - name: Run tests + - name: Run tests (Linux, macOS) if: matrix.os != 'windows-latest' run: npx spago test -- --timeout 30 From 7de2a8a5008b7931823fb4d781f4c2871186acdd Mon Sep 17 00:00:00 2001 From: Fyodor Soikin Date: Thu, 1 Aug 2024 17:52:53 -0400 Subject: [PATCH 09/18] Debug --- .github/workflows/build.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 632645b..6d18bc7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,10 +61,5 @@ jobs: - name: Build the project run: npx spago build - - name: Run tests (Windows) - if: matrix.os == 'windows-latest' - run: npx spago test -- "--timeout 30" - - - name: Run tests (Linux, macOS) - if: matrix.os != 'windows-latest' - run: npx spago test -- --timeout 30 + - name: Run tests + run: npx spago test '--' --timeout 30 From 6c23ff8298e08ca010f5fff7f0d875f487aae41a Mon Sep 17 00:00:00 2001 From: Fyodor Soikin Date: Thu, 1 Aug 2024 17:58:09 -0400 Subject: [PATCH 10/18] Debug --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6d18bc7..a225ab0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,6 +44,10 @@ jobs: ${{ runner.os }}-build- ${{ runner.os }}- + - name: Install global NPM packages + if: matrix.os == 'ubuntu-latest' + run: npm i --global purescript@0.15.15 spago@next purs-tidy@latest esbuild@latest + - name: Cache PureScript dependencies uses: actions/cache@v4 with: From b901d57a2853e5891ccb35b9a791faa6dc3acb7c Mon Sep 17 00:00:00 2001 From: Fyodor Soikin Date: Thu, 1 Aug 2024 18:00:20 -0400 Subject: [PATCH 11/18] Debug --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a225ab0..2b95364 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,7 @@ jobs: ${{ runner.os }}- - name: Install global NPM packages - if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'windows-latest' run: npm i --global purescript@0.15.15 spago@next purs-tidy@latest esbuild@latest - name: Cache PureScript dependencies From 872c5a7bd93421318e0b522694c638ce54237fdc Mon Sep 17 00:00:00 2001 From: Fyodor Soikin Date: Thu, 1 Aug 2024 18:07:25 -0400 Subject: [PATCH 12/18] Debug --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b95364..bf517fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,4 +66,4 @@ jobs: run: npx spago build - name: Run tests - run: npx spago test '--' --timeout 30 + run: npx spago test '--' --timeout 60 From c0861b391e00eebbd0f6acab131aefbd5b6dc36e Mon Sep 17 00:00:00 2001 From: Fyodor Soikin Date: Thu, 1 Aug 2024 18:18:20 -0400 Subject: [PATCH 13/18] Debug --- test/Test/Main.purs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/Test/Main.purs b/test/Test/Main.purs index 1dc8497..e8a8095 100644 --- a/test/Test/Main.purs +++ b/test/Test/Main.purs @@ -74,9 +74,9 @@ main = runSpecAndExitProcess [consoleReporter] $ where runTest args' = do let opts = _ { cwd = Just "test-fixtures/project", stdin = Just pipe, stdout = Just pipe, stderr = Just pipe } - args = ["spago", "test", "--"] <> args' - execa "npx" ["spago", "build"] opts >>= _.getResult >>= shouldSucceed - execa "npx" args opts >>= _.getResult + args = ["test", "--"] <> args' + execa "spago" ["build"] opts >>= _.getResult >>= shouldSucceed + execa "spago" args opts >>= _.getResult nukeLastResults = FS.rm' "test-fixtures/project/.spec-results" From 431aec9f0597927d1bab601c02f3ecfb6433e165 Mon Sep 17 00:00:00 2001 From: Fyodor Soikin Date: Thu, 1 Aug 2024 18:27:09 -0400 Subject: [PATCH 14/18] Debug --- test/Test/Main.purs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/Test/Main.purs b/test/Test/Main.purs index e8a8095..bb20f44 100644 --- a/test/Test/Main.purs +++ b/test/Test/Main.purs @@ -3,16 +3,19 @@ module Test.Main where import Prelude import Data.Array (intercalate) -import Data.Maybe (Maybe(..)) +import Data.Maybe (Maybe(..), fromMaybe) import Data.String (trim) import Data.String.Regex (replace) as Regex import Data.String.Regex.Flags (global) as Regex import Data.String.Regex.Unsafe (unsafeRegex) as Regex import Effect (Effect) +import Effect.Class (liftEffect) import Node.ChildProcess.Types (Exit(..), pipe) import Node.Encoding (Encoding(..)) import Node.FS.Aff as FS import Node.Library.Execa (execa) +import Node.Platform (Platform(..)) +import Node.Process (lookupEnv, platform) import Test.Spec as Spec import Test.Spec.Assertions (fail) import Test.Spec.Reporter (consoleReporter) @@ -75,8 +78,9 @@ main = runSpecAndExitProcess [consoleReporter] $ runTest args' = do let opts = _ { cwd = Just "test-fixtures/project", stdin = Just pipe, stdout = Just pipe, stderr = Just pipe } args = ["test", "--"] <> args' - execa "spago" ["build"] opts >>= _.getResult >>= shouldSucceed - execa "spago" args opts >>= _.getResult + cmd <- spagoCmd + execa cmd ["build"] opts >>= _.getResult >>= shouldSucceed + execa cmd args opts >>= _.getResult nukeLastResults = FS.rm' "test-fixtures/project/.spec-results" @@ -146,3 +150,7 @@ main = runSpecAndExitProcess [consoleReporter] $ stripColors = Regex.replace colorRegex "" colorRegex = Regex.unsafeRegex "\x1B\\[([0-9]|;)+m" Regex.global + + spagoCmd = case platform of + Just Win32 -> "spago.ps1" + _ -> "spago" From f726279bf7fe6d6a4622f7e2f946da3716c42cd7 Mon Sep 17 00:00:00 2001 From: Fyodor Soikin Date: Thu, 1 Aug 2024 18:29:24 -0400 Subject: [PATCH 15/18] Debug --- test/Test/Main.purs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/Test/Main.purs b/test/Test/Main.purs index bb20f44..04b05d3 100644 --- a/test/Test/Main.purs +++ b/test/Test/Main.purs @@ -3,19 +3,18 @@ module Test.Main where import Prelude import Data.Array (intercalate) -import Data.Maybe (Maybe(..), fromMaybe) +import Data.Maybe (Maybe(..)) import Data.String (trim) import Data.String.Regex (replace) as Regex import Data.String.Regex.Flags (global) as Regex import Data.String.Regex.Unsafe (unsafeRegex) as Regex import Effect (Effect) -import Effect.Class (liftEffect) import Node.ChildProcess.Types (Exit(..), pipe) import Node.Encoding (Encoding(..)) import Node.FS.Aff as FS import Node.Library.Execa (execa) import Node.Platform (Platform(..)) -import Node.Process (lookupEnv, platform) +import Node.Process (platform) import Test.Spec as Spec import Test.Spec.Assertions (fail) import Test.Spec.Reporter (consoleReporter) @@ -78,9 +77,8 @@ main = runSpecAndExitProcess [consoleReporter] $ runTest args' = do let opts = _ { cwd = Just "test-fixtures/project", stdin = Just pipe, stdout = Just pipe, stderr = Just pipe } args = ["test", "--"] <> args' - cmd <- spagoCmd - execa cmd ["build"] opts >>= _.getResult >>= shouldSucceed - execa cmd args opts >>= _.getResult + execa spagoCmd ["build"] opts >>= _.getResult >>= shouldSucceed + execa spagoCmd args opts >>= _.getResult nukeLastResults = FS.rm' "test-fixtures/project/.spec-results" From 6d35983661c19e877c753c50a3dae31a482bd5e6 Mon Sep 17 00:00:00 2001 From: Fyodor Soikin Date: Thu, 1 Aug 2024 18:37:04 -0400 Subject: [PATCH 16/18] Debug --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf517fe..15020fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,4 +66,4 @@ jobs: run: npx spago build - name: Run tests - run: npx spago test '--' --timeout 60 + run: npx spago test '--' --timeout 300 From 4226f0e8aff7b71fdade9dccd2946ec9dcfcdc76 Mon Sep 17 00:00:00 2001 From: Fyodor Soikin Date: Thu, 1 Aug 2024 19:52:21 -0400 Subject: [PATCH 17/18] Debug --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 15020fd..2f7f53c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,4 +66,4 @@ jobs: run: npx spago build - name: Run tests - run: npx spago test '--' --timeout 300 + run: npx spago test '--' --no-timeout From 272b5ff865c144977d697c50bffbb0dd57e55d95 Mon Sep 17 00:00:00 2001 From: Fyodor Soikin Date: Thu, 1 Aug 2024 20:32:37 -0400 Subject: [PATCH 18/18] Inherit stdin --- test/Test/Main.purs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Test/Main.purs b/test/Test/Main.purs index 04b05d3..233d9ee 100644 --- a/test/Test/Main.purs +++ b/test/Test/Main.purs @@ -9,7 +9,7 @@ import Data.String.Regex (replace) as Regex import Data.String.Regex.Flags (global) as Regex import Data.String.Regex.Unsafe (unsafeRegex) as Regex import Effect (Effect) -import Node.ChildProcess.Types (Exit(..), pipe) +import Node.ChildProcess.Types (Exit(..), pipe, inherit) import Node.Encoding (Encoding(..)) import Node.FS.Aff as FS import Node.Library.Execa (execa) @@ -75,7 +75,7 @@ main = runSpecAndExitProcess [consoleReporter] $ where runTest args' = do - let opts = _ { cwd = Just "test-fixtures/project", stdin = Just pipe, stdout = Just pipe, stderr = Just pipe } + let opts = _ { cwd = Just "test-fixtures/project", stdin = Just inherit, stdout = Just pipe, stderr = Just pipe } args = ["test", "--"] <> args' execa spagoCmd ["build"] opts >>= _.getResult >>= shouldSucceed execa spagoCmd args opts >>= _.getResult