all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to test modified shepherd services
@ 2021-12-19 22:47 Nathan Dehnel
  2021-12-20  3:28 ` raingloom
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Nathan Dehnel @ 2021-12-19 22:47 UTC (permalink / raw)
  To: guix-devel

I modified a shepherd service to accept a new field from config.scm
and I was wondering how to test that it works correctly. Do I need to
make a VM from my modified guix repo with pre-inst-env?


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to test modified shepherd services
  2021-12-19 22:47 How to test modified shepherd services Nathan Dehnel
@ 2021-12-20  3:28 ` raingloom
  2021-12-20 10:00 ` Attila Lendvai
  2021-12-20 14:08 ` Simon South
  2 siblings, 0 replies; 6+ messages in thread
From: raingloom @ 2021-12-20  3:28 UTC (permalink / raw)
  To: Nathan Dehnel; +Cc: guix-devel

On Sun, 19 Dec 2021 16:47:07 -0600
Nathan Dehnel <ncdehnel@gmail.com> wrote:

> I modified a shepherd service to accept a new field from config.scm
> and I was wondering how to test that it works correctly. Do I need to
> make a VM from my modified guix repo with pre-inst-env?
> 

That's probably the best way, it's how I was testing the yggdrasil
service. Definitely do not reconfigure without first testing it in a VM
or container or something.

Word of warning: shepherd is not very forthcoming with logs. You might
want to add some extra logging and redirect output to a file.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to test modified shepherd services
  2021-12-19 22:47 How to test modified shepherd services Nathan Dehnel
  2021-12-20  3:28 ` raingloom
@ 2021-12-20 10:00 ` Attila Lendvai
  2021-12-20 22:38   ` Nathan Dehnel
  2021-12-20 14:08 ` Simon South
  2 siblings, 1 reply; 6+ messages in thread
From: Attila Lendvai @ 2021-12-20 10:00 UTC (permalink / raw)
  To: Nathan Dehnel; +Cc: guix-devel

i have just finished my first Guix service. for now it's a PR for that other channel, so i'll copy-paste some stuff from it:

Run with something like this:

$(guix system --no-graphic vm path/to/swarm.scm) -m 2048

$(./pre-inst-env guix system --no-graphic vm /path/to/swarm.scm) -m 2048

this will build and boot an operating-system object in a Qemu VM, in the same terminal.

the file should return a simple-operating-system object, optionally wrapped into a marionette-operating-system if you also want to write/run automated tests.

i'll send you the link to the actual code in a private email.

- attila
PGP: 5D5F 45C7 DFCD 0A39



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to test modified shepherd services
  2021-12-19 22:47 How to test modified shepherd services Nathan Dehnel
  2021-12-20  3:28 ` raingloom
  2021-12-20 10:00 ` Attila Lendvai
@ 2021-12-20 14:08 ` Simon South
  2021-12-27  3:20   ` Maxim Cournoyer
  2 siblings, 1 reply; 6+ messages in thread
From: Simon South @ 2021-12-20 14:08 UTC (permalink / raw)
  To: Nathan Dehnel; +Cc: guix-devel

Nathan Dehnel <ncdehnel@gmail.com> writes:
> I modified a shepherd service to accept a new field from config.scm
> and I was wondering how to test that it works correctly.

Assuming this is an existing Guix service, it's probably easiest to
update the corresponding system test suite under gnu/tests (if
necessary) to reflect your change, then run the suite with "make
check-system" (setting "TESTS" to limit it to the service in question)
to make sure everything works the way you expect.

If you're planning on contributing the change to Guix it would be good
to submit it along with an updated test suite anyway.

The Guix manual has a bit of information about this in Section 2.3,
"Running the Test Suite":

https://guix.gnu.org/en/manual/en/html_node/Running-the-Test-Suite.html#Running-the-Test-Suite

-- 
Simon South
simon@simonsouth.net


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to test modified shepherd services
  2021-12-20 10:00 ` Attila Lendvai
@ 2021-12-20 22:38   ` Nathan Dehnel
  0 siblings, 0 replies; 6+ messages in thread
From: Nathan Dehnel @ 2021-12-20 22:38 UTC (permalink / raw)
  To: Attila Lendvai; +Cc: guix-devel

Thanks, that worked.

On Mon, Dec 20, 2021 at 4:00 AM Attila Lendvai <attila@lendvai.name> wrote:
>
> i have just finished my first Guix service. for now it's a PR for that other channel, so i'll copy-paste some stuff from it:
>
> Run with something like this:
>
> $(guix system --no-graphic vm path/to/swarm.scm) -m 2048
>
> $(./pre-inst-env guix system --no-graphic vm /path/to/swarm.scm) -m 2048
>
> this will build and boot an operating-system object in a Qemu VM, in the same terminal.
>
> the file should return a simple-operating-system object, optionally wrapped into a marionette-operating-system if you also want to write/run automated tests.
>
> i'll send you the link to the actual code in a private email.
>
> - attila
> PGP: 5D5F 45C7 DFCD 0A39
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How to test modified shepherd services
  2021-12-20 14:08 ` Simon South
@ 2021-12-27  3:20   ` Maxim Cournoyer
  0 siblings, 0 replies; 6+ messages in thread
From: Maxim Cournoyer @ 2021-12-27  3:20 UTC (permalink / raw)
  To: Simon South; +Cc: Nathan Dehnel, guix-devel

Hello,

Simon South <simon@simonsouth.net> writes:

> Nathan Dehnel <ncdehnel@gmail.com> writes:
>> I modified a shepherd service to accept a new field from config.scm
>> and I was wondering how to test that it works correctly.
>
> Assuming this is an existing Guix service, it's probably easiest to
> update the corresponding system test suite under gnu/tests (if
> necessary) to reflect your change, then run the suite with "make
> check-system" (setting "TESTS" to limit it to the service in question)
> to make sure everything works the way you expect.
>
> If you're planning on contributing the change to Guix it would be good
> to submit it along with an updated test suite anyway.
>
> The Guix manual has a bit of information about this in Section 2.3,
> "Running the Test Suite":
>
> https://guix.gnu.org/en/manual/en/html_node/Running-the-Test-Suite.html#Running-the-Test-Suite

+1.  System tests are the best way to validate system services.  You'll
save time by writing/extending one.

Maxim


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-12-27  3:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-19 22:47 How to test modified shepherd services Nathan Dehnel
2021-12-20  3:28 ` raingloom
2021-12-20 10:00 ` Attila Lendvai
2021-12-20 22:38   ` Nathan Dehnel
2021-12-20 14:08 ` Simon South
2021-12-27  3:20   ` Maxim Cournoyer

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.