mCaptcha: Projects-old -> Projects#817
Conversation
|
@eljamm , could you please review it? I am encountering some problems when running the example and the test. For the test, I get the following error when executing this command: nix --extra-experimental-features "nix-command flakes" build .#checks.x86_64-linux.projects/mcaptcha/nixos/tests/basic For the example, I get the following error when executing this command: nix --extra-experimental-features "nix-command flakes" build .#checks.x86_64-linux.projects/mcaptcha/nixos/examples/basic |
| # - Set attributes to `null` to indicate that they're needed, but not available | ||
| # - Remove comments that are only relevant to the template when using it | ||
| metadata = { | ||
| summary = "mCaptcha is a backend component for a CAPTCHA system designed to provide a seamless user experience without unnecessary complexity."; |
There was a problem hiding this comment.
Let's keep it short
| summary = "mCaptcha is a backend component for a CAPTCHA system designed to provide a seamless user experience without unnecessary complexity."; | |
| summary = "Privacy-friendly Proof of Work (PoW) based CAPTCHA system"; |
There was a problem hiding this comment.
Let's remove this file, since it's not testing anything
There was a problem hiding this comment.
Please delete the projects-old/mCaptcha directory
There was a problem hiding this comment.
The directory should be projects/mCaptcha, not projects/mcaptcha. Please mind the letter's case.
| # examples = { | ||
| # bringService = { | ||
| # description = "use a database and other services running on a different node"; | ||
| # module = ./services/mcaptcha/examples/basic.nix; | ||
| # tests.bringService = import ./services/mcaptcha/tests/bring-your-own-services.nix args; | ||
| # }; | ||
| # createLocally = { | ||
| # description = "use a database and other services running on the same node"; | ||
| # module = ./services/mcaptcha/examples/basic.nix; | ||
| # tests.createLocally = import ./services/mcaptcha/tests/create-locally.nix args; | ||
| # }; | ||
| # }; |
There was a problem hiding this comment.
Let's just make these free-standing tests (see here)
| # examples = { | |
| # bringService = { | |
| # description = "use a database and other services running on a different node"; | |
| # module = ./services/mcaptcha/examples/basic.nix; | |
| # tests.bringService = import ./services/mcaptcha/tests/bring-your-own-services.nix args; | |
| # }; | |
| # createLocally = { | |
| # description = "use a database and other services running on the same node"; | |
| # module = ./services/mcaptcha/examples/basic.nix; | |
| # tests.createLocally = import ./services/mcaptcha/tests/create-locally.nix args; | |
| # }; | |
| # }; |
| }; | ||
| }; | ||
| }; | ||
| }; |
There was a problem hiding this comment.
| }; | |
| }; | |
| nixos.tests.bring-your-own-services = import ./services/mcaptcha/tests/bring-your-own-services.nix args; | |
| nixos.tests.create-locally = import ./services/mcaptcha/tests/create-locally.nix args; | |
| nixos.tests.basic = import ./services/mcaptcha/tests/basic.nix args; |
There was a problem hiding this comment.
From the error you got, we know that this example is not going to be enough to set up the service. Lets just delete this file and set the example attribute to null examples.basic = null; to indicate that it's something we want, but is not available, yet.
error: attribute 'database' missing
at /nix/store/nmsrnrwd7yw953rsr23myp2xcjwcvixp-source/projects/mcaptcha/services/mcaptcha/module.nix:155:81:
154| assertion = (!cfg.database.createLocally) -> (cfg.settings.database.username != null);
155| message = "If `${opt.database.createLocally}` is not specified, then `${opt.settings.database.username}` must be specified";
| ^
156| }There was a problem hiding this comment.
Same comment as the service example. Let's remove this since it's not simple to set up.
Co-authored-by: Fedi Jamoussi <Fedi.Jamoussi@protonmail.ch>
…into mcaptcha-migration
|
@eljamm I still have issues when I run the tests :(
|
| imports = [ | ||
| sources.modules.ngipkgs | ||
| sources.modules.services.mcaptcha | ||
| sources.examples.mcaptcha.basic |
There was a problem hiding this comment.
If examples.basic = null; then there is no example to import.
| sources.examples.mcaptcha.basic |
There was a problem hiding this comment.
I though the basic test did something, but apparently that wasn't the case. Let's just remove this file.
|
|
||
| nixos.tests.bring-your-own-services = import ./services/mcaptcha/tests/bring-your-own-services.nix args; | ||
| nixos.tests.create-locally = import ./services/mcaptcha/tests/create-locally.nix args; | ||
| nixos.tests.basic = import ./services/mcaptcha/tests/basic.nix args; |
There was a problem hiding this comment.
| nixos.tests.basic = import ./services/mcaptcha/tests/basic.nix args; |
|
@eljamm I've been trying different ways but I keep getting the same error. Even disabling the sandbox, but the issue persists.
Could you please run the tests to see if it's my system that is causing the issues? 🙏 |
There was a problem hiding this comment.
We don't need projects/mCaptcha/programs since I think the mcaptcha and mcaptcha-cache artefacts only run properly in the context of the service module.
To resolve #736