Skip to content

Rosenpass: projects-old -> projects#786

Merged
eljamm merged 9 commits into
ngi-nix:mainfrom
khabdrick:migrate-rosenpass
Apr 14, 2025
Merged

Rosenpass: projects-old -> projects#786
eljamm merged 9 commits into
ngi-nix:mainfrom
khabdrick:migrate-rosenpass

Conversation

@khabdrick
Copy link
Copy Markdown
Contributor

fixes #742

Comment thread projects/Rosenpass/default.nix Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You need to delete projects-old/Rosenpass as well

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I just wanted to be sure I got all the data out of there correctly first.
I will delete the directory now.

khabdrick and others added 2 commits April 11, 2025 17:20
Co-authored-by: Fedi Jamoussi <Fedi.Jamoussi@protonmail.ch>
Copy link
Copy Markdown
Contributor

@eljamm eljamm Apr 11, 2025

Choose a reason for hiding this comment

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

Since we have a full-fledged tests under projects-old/Rosenpass/tests, we should use them, and not just delete them. Add these to the nixos.modules.services.rosenpass tests.

    tests.with-sops = import ./tests args;
    tests.without-sops = "${sources.inputs.nixpkgs}/nixos/tests/rosenpass.nix";

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

image

What file should I attach for the test?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What do you mean? You can just set these attributes either in an example or in nixos.tests

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I did that but I was getting something about path not existing. I even reverted to use the basic test and I am getting same error
image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's because the path to the tests is wrong. You either move the tests directory to ./tests and set tests.with-sops = import ./tests args; or you set the path to where the directory exists tests.with-sops = import ./<path_where_tests_directory_is> args;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's delete this since it's not testing anything

Comment thread projects/Rosenpass/default.nix Outdated
Comment thread projects/Rosenpass/default.nix Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's because the path to the tests is wrong. You either move the tests directory to ./tests and set tests.with-sops = import ./tests args; or you set the path to where the directory exists tests.with-sops = import ./<path_where_tests_directory_is> args;

Comment on lines +15 to +16
sources.modules.programs._serviceName_
sources.examples._ProjectName_._exampleName_ # i.e _ProjectName_.basic
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  1. You need to replace _serviceName_ with the actual service name...
  2. But let's just delete this file since it doesn't test anything
Suggested change
sources.modules.programs._serviceName_
sources.examples._ProjectName_._exampleName_ # i.e _ProjectName_.basic
sources.modules.programs._serviceName_
sources.examples._ProjectName_._exampleName_ # i.e _ProjectName_.basic

{ ... }:

{
services._serviceName_.enable = true;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's not enough to copy the template, you need to modify it as well... _serviceName_ should be replace with the actual service name

khabdrick and others added 3 commits April 13, 2025 14:59
Co-authored-by: Fedi Jamoussi <Fedi.Jamoussi@protonmail.ch>
Co-authored-by: Fedi Jamoussi <Fedi.Jamoussi@protonmail.ch>
@khabdrick
Copy link
Copy Markdown
Contributor Author

I just moved the tests to ./tests and we still have the same error.
Also, I am still using this command nix build .#checks.x86_64-linux.projects/Rosenpass/nixos/tests/basic --extra-experimental-features "flakes nix-command" --show-trace

image

I really thought this would be a walk in the park.

@eljamm
Copy link
Copy Markdown
Contributor

eljamm commented Apr 14, 2025

The command should be:

nix build .#checks.x86_64-linux.projects/Rosenpass/nixos/tests/<TEST_NAME>

Where TEST_NAME should be substituted with the name of the test. In this case, we have 2 tests with-sops and without-sops. So you need to specify one of them. That said, if you type .#checks.x86_64-linux.projects/Rosenpass/nixos/tests/ and click tab, you should see auto-completion for the available tests.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please remove this file. It's not testing anything.

Comment thread projects/Rosenpass/tests/basic.nix Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please remove this file. It's not testing anything.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Either modify the template names or just remove this file.

@khabdrick
Copy link
Copy Markdown
Contributor Author

How does it look now?

Copy link
Copy Markdown
Contributor

@eljamm eljamm left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@eljamm eljamm changed the title rosenpass migration initial commit Rosenpass: projects-old -> projects Apr 14, 2025
@eljamm eljamm merged commit bde2830 into ngi-nix:main Apr 14, 2025
2 checks passed
@github-project-automation github-project-automation Bot moved this to Done in Nix@NGI Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Migrate Rosenpass from projects-old to projects

2 participants