Skip to content

Commit

Permalink
Fixup CI (#1066)
Browse files Browse the repository at this point in the history
* Test extra install

* Extra install

* fix test

* remove only

* Flip the bit

* Bump versions for console

* Bump console version

* Bump console version

* Update source map

* Update source map

* Fix test for windows

* Fix test on windows

* Escape path separators
  • Loading branch information
CharlesTaylor7 authored Oct 11, 2023
1 parent 29cd3ca commit 1875379
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 12 deletions.
2 changes: 1 addition & 1 deletion test-fixtures/bundle-app-map.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test-fixtures/bundle-module-map.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test-fixtures/list-dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"console": {
"type": "registry",
"value": {
"version": "6.0.0"
"version": "6.1.0"
}
},
"effect": {
Expand Down
2 changes: 1 addition & 1 deletion test-fixtures/list-dependencies.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
+---------+---------+----------+
| Package | Version | Location |
+---------+---------+----------+
| console | 6.0.0 | - |
| console | 6.1.0 | - |
| effect | 4.0.0 | - |
| prelude | 6.0.1 | - |
+---------+---------+----------+
2 changes: 1 addition & 1 deletion test-fixtures/sources-output.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
src/**/*.purs
test/**/*.purs
.spago/packages/console-6.0.0/src/**/*.purs
.spago/packages/console-6.1.0/src/**/*.purs
.spago/packages/effect-4.0.0/src/**/*.purs
.spago/packages/prelude-6.0.1/src/**/*.purs
2 changes: 1 addition & 1 deletion test-fixtures/sources-output.win.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
src\**\*.purs
test\**\*.purs
.spago\packages\console-6.0.0\src\**\*.purs
.spago\packages\console-6.1.0\src\**\*.purs
.spago\packages\effect-4.0.0\src\**\*.purs
.spago\packages\prelude-6.0.1\src\**\*.purs
2 changes: 1 addition & 1 deletion test-fixtures/sources-subproject-output.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.spago/packages/console-6.0.0/src/**/*.purs
.spago/packages/console-6.1.0/src/**/*.purs
.spago/packages/effect-4.0.0/src/**/*.purs
.spago/packages/prelude-6.0.1/src/**/*.purs
subpackage/src/**/*.purs
Expand Down
2 changes: 1 addition & 1 deletion test-fixtures/sources-subproject-output.win.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.spago\packages\console-6.0.0\src\**\*.purs
.spago\packages\console-6.1.0\src\**\*.purs
.spago\packages\effect-4.0.0\src\**\*.purs
.spago\packages\prelude-6.0.1\src\**\*.purs
subpackage\src\**\*.purs
Expand Down
3 changes: 2 additions & 1 deletion test-fixtures/spago-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ package:
githubOwner: purescript
githubRepo: aaa
workspace:
extra_packages: {}
extra_packages:
console: "6.1.0"
package_set:
registry: 28.1.1
2 changes: 1 addition & 1 deletion test/Prelude.purs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ check checkers execResult = do
Left err -> err.stderr
Right res -> res.stderr

when true do
when false do
log $ "STDOUT:\n" <> prettyPrint stdout
log $ "STDERR:\n" <> prettyPrint stderr
execResult `Assert.shouldSatisfy` checkers.result
Expand Down
7 changes: 6 additions & 1 deletion test/Spago/Build/Polyrepo.purs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import Data.Set.NonEmpty as NonEmptySet
import Data.String (Pattern(..), Replacement(..))
import Data.String as String
import Node.Path as Path
import Node.Platform as Platform
import Node.Process as Process
import Registry.Version as Version
import Spago.Command.Init (DefaultConfigOptions(..))
import Spago.Command.Init as Init
Expand Down Expand Up @@ -464,8 +466,11 @@ spec = Spec.describe "polyrepo" do
setupPackageWithUnusedNameWarning "package-b" [ "package-a" ] true false -- no censoring, so this will fail to build
setupPackageWithUnusedNameWarning "package-c" [ "package-a", "package-b" ] true true
let
exp =
case Process.platform of
Just Platform.Win32 -> "[1/1 UnusedName] package-b\\src\\Main.purs:6:13"
_ -> "[1/1 UnusedName] package-b/src/Main.purs:6:13"
hasUnusedWarningError stdErr = do
let exp = "[1/1 UnusedName] package-b/src/Main.purs:6:13"
unless (String.contains (Pattern exp) stdErr) do
Assert.fail $ "STDERR did not contain texts:\n" <> exp <> "\n\nStderr was:\n" <> stdErr
spago [ "build" ] >>= check { stdout: mempty, stderr: hasUnusedWarningError, result: isLeft }
Expand Down
1 change: 1 addition & 0 deletions test/Spago/Publish.purs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ spec = Spec.around withTempDir do
spago [ "build" ] >>= shouldBeSuccess
doTheGitThing
-- It will fail because it can't hit the registry, but the fixture will check that everything else is ready
spago [ "fetch" ] >>= shouldBeSuccess
spago [ "publish", "--offline" ] >>= shouldBeFailureErr (fixture "publish.txt")

doTheGitThing :: Aff Unit
Expand Down
8 changes: 7 additions & 1 deletion test/Spago/Test.purs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import Test.Prelude
import Data.Array as Array
import Data.String as String
import Node.Path as Path
import Node.Platform as Platform
import Node.Process as Process
import Registry.Version as Version
import Spago.Command.Init (DefaultConfigOptions(..))
import Spago.Command.Init as Init
Expand Down Expand Up @@ -118,8 +120,12 @@ spec = Spec.around withTempDir do
, ""
]
let
exp =
case Process.platform of
Just Platform.Win32 -> "[1/1 UnusedName] test\\Test\\Main.purs:10:5"
_ -> "[1/1 UnusedName] test/Test/Main.purs:10:5"
hasUnusedNameWarningError stdErr = do
let exp = "[1/1 UnusedName] test/Test/Main.purs:10:5"

unless (String.contains (String.Pattern exp) stdErr) do
Assert.fail $ "STDERR did not contain text:\n" <> exp <> "\n\nStderr was:\n" <> stdErr
spago [ "test" ] >>= check { stdout: mempty, stderr: hasUnusedNameWarningError, result: isRight }
Expand Down

0 comments on commit 1875379

Please sign in to comment.