all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Clément Lassieur" <clement@lassieur.org>
To: "Gábor Boskovits" <boskovits@gmail.com>
Cc: 31911-done@debbugs.gnu.org
Subject: [bug#31911] services: Add prometheus-node-exporter-service-type.
Date: Mon, 09 Jul 2018 16:21:44 +0200	[thread overview]
Message-ID: <87pnzw8p6v.fsf@lassieur.org> (raw)
In-Reply-To: <CAE4v=pgwpfDsWxbbx1Gg2d90Hk7F0d5y+xBN8Z7MssnfXneDSA@mail.gmail.com>

Gábor Boskovits <boskovits@gmail.com> writes:

> Clément Lassieur <clement@lassieur.org> ezt írta (időpont: 2018. júl. 9.,
> H, 11:17):
>
>> Hi Gábor,
>>
>> Gábor Boskovits <boskovits@gmail.com> writes:
>>
>> > Pushed to master as a33652ee336ae9a5d2ab5fd54bf2397caec42a0e.
>>
>> > +          (test-assert "prometheus-node-exporter running"
>> > +            (marionette-eval
>> > +             '(begin
>> > +                (use-modules (gnu services herd))
>> > +                (match (start-service 'prometheus-node-exporter)
>> > +                  (#f #f)
>> > +                  (('service response-parts ...)
>> > +                   (match (assq-ref response-parts 'running)
>> > +                     ((pid) (number? pid))))))
>> > +             marionette))
>>
>> The PID check is useless because START-SERVICE will return #f if the
>> service fails to start.  Instead, I'd use:
>>
>>           (test-assert "prometheus-node-exporter running"
>>             (marionette-eval
>>              '(begin
>>                 (use-modules (gnu services herd))
>>                 (start-service 'prometheus-node-exporter))
>>              marionette))
>>
>> This would also make the test more robust to service changes (e.g. it
>> would still work if MAKE-FORKEXEC-CONSTRUCTOR is removed).
>>
>>
> Thanks, I will adjust accordingly. Incidentally the code is almost the same
> as in hpcguix-web test. Should we also adjust that?

You're welcome :-)  It's not urgent, but in the long term, it would be
good that all similar code is ajusted accordingly.  It's in lots of
other places as well if I remember well.

      reply	other threads:[~2018-07-09 14:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-20 12:59 [bug#31911] [PATCH] services: Add prometheus-node-exporter-service-type Gábor Boskovits
2018-06-23 21:51 ` Ludovic Courtès
2018-06-25  8:31   ` Gábor Boskovits
2018-06-25  8:56     ` Ludovic Courtès
2018-07-07 15:54       ` Ludovic Courtès
2018-07-07 18:14         ` Gábor Boskovits
2018-07-09  8:43 ` bug#31911: " Gábor Boskovits
2018-07-09  9:17   ` [bug#31911] " Clément Lassieur
2018-07-09 14:12     ` Gábor Boskovits
2018-07-09 14:21       ` Clément Lassieur [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pnzw8p6v.fsf@lassieur.org \
    --to=clement@lassieur.org \
    --cc=31911-done@debbugs.gnu.org \
    --cc=boskovits@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.