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 11:17:09 +0200	[thread overview]
Message-ID: <87sh4s93ai.fsf@lassieur.org> (raw)
In-Reply-To: <CAE4v=pjd+26rcbsE5=_tv9yD=01VBbz46atabwmvOzi8+7LauA@mail.gmail.com>

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).

Clément

  reply	other threads:[~2018-07-09  9:18 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   ` Clément Lassieur [this message]
2018-07-09 14:12     ` [bug#31911] " Gábor Boskovits
2018-07-09 14:21       ` Clément Lassieur

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=87sh4s93ai.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.