Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ result
*.sqlite3
*.sqlite3-wal
*.sqlite3-shm
.spec-results

# Keep it secret, keep it safe.
.env
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ nix flake check -L
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:

```sh
nix build checks.x86_64-linux.integration
nix build .#checks.x86_64-linux.integration
```

You can "deploy" the registry server to a local VM and manually hit the API as if it were the production server:
Expand Down
1 change: 1 addition & 0 deletions app/spago.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,4 @@ package:
dependencies:
- registry-test-utils
- spec
- spec-node
10 changes: 8 additions & 2 deletions app/test/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ import Test.Registry.App.Legacy.PackageSet as Test.Legacy.PackageSet
import Test.Registry.App.Manifest.SpagoYaml as Test.Manifest.SpagoYaml
import Test.Spec as Spec
import Test.Spec.Reporter.Console (consoleReporter)
import Test.Spec.Runner (defaultConfig, runSpec')
import Test.Spec.Runner.Node (runSpecAndExitProcess')
import Test.Spec.Runner.Node.Config as Cfg

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

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

Spec.describe "Registry.App.Manifest" do
Spec.describe "SpagoYaml" Test.Manifest.SpagoYaml.spec
where
config =
{ defaultConfig: Cfg.defaultConfig { timeout = Just $ Milliseconds 300_000.0 }
, parseCLIOptions: false
}
12 changes: 6 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

outputs =
{
self,
nixpkgs,
flake-utils,
purescript-overlay,
Expand All @@ -39,9 +38,6 @@
"aarch64-darwin"
];

# Users authorized to deploy to the registry.
deployers = import ./nix/deployers.nix;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was unused code — the deployers are already imported directly into the module.nix


pureScriptFileset = fileset.intersection (fileset.gitTracked ./.) (
fileset.unions [
./app
Expand Down Expand Up @@ -288,6 +284,7 @@
mkAppOutput = drv: {
type = "app";
program = "${drv}/bin/${drv.name}";
meta.description = drv.meta.description or "PureScript Registry ${drv.name}";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New build warnings on missing meta fields in apps

};

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

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

checks = {
Expand Down
1 change: 1 addition & 0 deletions foreign/spago.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ package:
- node-process
- registry-test-utils
- spec
- spec-node
5 changes: 2 additions & 3 deletions foreign/test/Foreign.purs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ module Test.Foreign (main) where
import Prelude

import Effect (Effect)
import Effect.Aff as Aff
import Test.Registry.Foreign.FastGlob as Foreign.FastGlob
import Test.Registry.Foreign.Gzip as Foreign.Gzip
import Test.Registry.Foreign.JsonRepair as Foreign.JsonRepair
import Test.Registry.Foreign.SPDX as Foreign.SPDX
import Test.Spec as Spec
import Test.Spec.Reporter.Console (consoleReporter)
import Test.Spec.Runner (runSpec)
import Test.Spec.Runner.Node (runSpecAndExitProcess)

main :: Effect Unit
main = Aff.launchAff_ $ runSpec [ consoleReporter ] do
main = runSpecAndExitProcess [ consoleReporter ] do
Spec.describe "Foreign" do
Spec.describe "SPDX" Foreign.SPDX.spec
Spec.describe "JsonRepair" Foreign.JsonRepair.spec
Expand Down
1 change: 1 addition & 0 deletions lib/spago.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ package:
- node-execa
- registry-test-utils
- spec
- spec-node
5 changes: 2 additions & 3 deletions lib/test/Registry.purs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module Test.Registry where
import Prelude

import Effect (Effect)
import Effect.Aff as Aff
import Test.Registry.Internal as Test.Internal
import Test.Registry.Manifest as Test.Manifest
import Test.Registry.ManifestIndex as Test.ManifestIndex
Expand All @@ -20,10 +19,10 @@ import Test.Registry.Solver as Test.Solver
import Test.Registry.Version as Test.Version
import Test.Spec as Spec
import Test.Spec.Reporter as Spec.Reporter
import Test.Spec.Runner as Spec.Runner
import Test.Spec.Runner.Node (runSpecAndExitProcess)

main :: Effect Unit
main = Aff.launchAff_ $ Spec.Runner.runSpec [ Spec.Reporter.consoleReporter ] do
main = runSpecAndExitProcess [ Spec.Reporter.consoleReporter ] do
Spec.describe "Internal"
Test.Internal.spec

Expand Down
Loading