Skip to content

Commit 00000a7

Browse files
upgrade package set, tidy up (#705)
1 parent 772586e commit 00000a7

File tree

11 files changed

+276
-66
lines changed

11 files changed

+276
-66
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ result
1515
*.sqlite3
1616
*.sqlite3-wal
1717
*.sqlite3-shm
18+
.spec-results
1819

1920
# Keep it secret, keep it safe.
2021
.env

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ nix flake check -L
7878
There is an integration test that will deploy the registry server and make requests to the API, which you can run if you are on a Linux machine. It is included in the `nix flake check` command by default, but it can be convenient to run standalone as well:
7979

8080
```sh
81-
nix build checks.x86_64-linux.integration
81+
nix build .#checks.x86_64-linux.integration
8282
```
8383

8484
You can "deploy" the registry server to a local VM and manually hit the API as if it were the production server:

app/spago.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,4 @@ package:
7777
dependencies:
7878
- registry-test-utils
7979
- spec
80+
- spec-node

app/test/Main.purs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ import Test.Registry.App.Legacy.PackageSet as Test.Legacy.PackageSet
1818
import Test.Registry.App.Manifest.SpagoYaml as Test.Manifest.SpagoYaml
1919
import Test.Spec as Spec
2020
import Test.Spec.Reporter.Console (consoleReporter)
21-
import Test.Spec.Runner (defaultConfig, runSpec')
21+
import Test.Spec.Runner.Node (runSpecAndExitProcess')
22+
import Test.Spec.Runner.Node.Config as Cfg
2223

2324
main :: Effect Unit
24-
main = launchAff_ $ runSpec' (defaultConfig { timeout = Just $ Milliseconds 300_000.0 }) [ consoleReporter ] do
25+
main = runSpecAndExitProcess' config [ consoleReporter ] do
2526
Spec.describe "Registry.App.API" do
2627
Test.API.spec
2728

@@ -48,3 +49,8 @@ main = launchAff_ $ runSpec' (defaultConfig { timeout = Just $ Milliseconds 300_
4849

4950
Spec.describe "Registry.App.Manifest" do
5051
Spec.describe "SpagoYaml" Test.Manifest.SpagoYaml.spec
52+
where
53+
config =
54+
{ defaultConfig: Cfg.defaultConfig { timeout = Just $ Milliseconds 300_000.0 }
55+
, parseCLIOptions: false
56+
}

flake.nix

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
outputs =
2323
{
24-
self,
2524
nixpkgs,
2625
flake-utils,
2726
purescript-overlay,
@@ -39,9 +38,6 @@
3938
"aarch64-darwin"
4039
];
4140

42-
# Users authorized to deploy to the registry.
43-
deployers = import ./nix/deployers.nix;
44-
4541
pureScriptFileset = fileset.intersection (fileset.gitTracked ./.) (
4642
fileset.unions [
4743
./app
@@ -288,6 +284,7 @@
288284
mkAppOutput = drv: {
289285
type = "app";
290286
program = "${drv}/bin/${drv.name}";
287+
meta.description = drv.meta.description or "PureScript Registry ${drv.name}";
291288
};
292289

293290
# A full set of environment variables, each set to their default values
@@ -358,8 +355,11 @@
358355
packages = pkgs.registry.apps // pkgs.registry.scripts;
359356

360357
apps = pkgs.lib.mapAttrs (_: drv: mkAppOutput drv) packages // {
361-
default.type = "app";
362-
default.program = "${run-vm}";
358+
default = {
359+
type = "app";
360+
program = "${run-vm}";
361+
meta.description = "Run the registry server in a NixOS VM";
362+
};
363363
};
364364

365365
checks = {

foreign/spago.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,4 @@ package:
4949
- node-process
5050
- registry-test-utils
5151
- spec
52+
- spec-node

foreign/test/Foreign.purs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ module Test.Foreign (main) where
33
import Prelude
44

55
import Effect (Effect)
6-
import Effect.Aff as Aff
76
import Test.Registry.Foreign.FastGlob as Foreign.FastGlob
87
import Test.Registry.Foreign.Gzip as Foreign.Gzip
98
import Test.Registry.Foreign.JsonRepair as Foreign.JsonRepair
109
import Test.Registry.Foreign.SPDX as Foreign.SPDX
1110
import Test.Spec as Spec
1211
import Test.Spec.Reporter.Console (consoleReporter)
13-
import Test.Spec.Runner (runSpec)
12+
import Test.Spec.Runner.Node (runSpecAndExitProcess)
1413

1514
main :: Effect Unit
16-
main = Aff.launchAff_ $ runSpec [ consoleReporter ] do
15+
main = runSpecAndExitProcess [ consoleReporter ] do
1716
Spec.describe "Foreign" do
1817
Spec.describe "SPDX" Foreign.SPDX.spec
1918
Spec.describe "JsonRepair" Foreign.JsonRepair.spec

lib/spago.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,4 @@ package:
5353
- node-execa
5454
- registry-test-utils
5555
- spec
56+
- spec-node

lib/test/Registry.purs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ module Test.Registry where
33
import Prelude
44

55
import Effect (Effect)
6-
import Effect.Aff as Aff
76
import Test.Registry.Internal as Test.Internal
87
import Test.Registry.Manifest as Test.Manifest
98
import Test.Registry.ManifestIndex as Test.ManifestIndex
@@ -20,10 +19,10 @@ import Test.Registry.Solver as Test.Solver
2019
import Test.Registry.Version as Test.Version
2120
import Test.Spec as Spec
2221
import Test.Spec.Reporter as Spec.Reporter
23-
import Test.Spec.Runner as Spec.Runner
22+
import Test.Spec.Runner.Node (runSpecAndExitProcess)
2423

2524
main :: Effect Unit
26-
main = Aff.launchAff_ $ Spec.Runner.runSpec [ Spec.Reporter.consoleReporter ] do
25+
main = runSpecAndExitProcess [ Spec.Reporter.consoleReporter ] do
2726
Spec.describe "Internal"
2827
Test.Internal.spec
2928

0 commit comments

Comments
 (0)