lundi 30 novembre 2015

best way to check logs after Makefile command

One of my projects' Makefile runs a bunch of tests on a headless browser for the functional test step. Most of the test is for the front-end code, but i also check for any error/warning on the backend.

Currently, we are cleaning the web server log, running all the (very slow) tests, and then grepping the server log for any error or warning.

i was wondering if there was any way to have a listener parsing the log (e.g. tail -f | grep) starting on the background, and kill the make target if it detects any error/warning during the test run.

what i got so far was

  1. start long lived grep in the background and store PID.
  2. run tests.
  3. check output of long lived grep
  4. kill PID.
  5. in case of any error, fail.

This only bought me the advantage that now i do not lose the server logs on my dev box every time, as i do not have to clean it every time. But i still have to wait a long time (minutes) for a failure that may have occurred in the very first one.

is there any solution for it?

Aucun commentaire:

Enregistrer un commentaire