From db630aaa8b261503076eb7320ee3cee5a5582be8 Mon Sep 17 00:00:00 2001 From: Clement Delafargue Date: Tue, 30 Jun 2020 15:46:41 +0200 Subject: fix(tests): use `! grep` instead of `grep -v` `grep -v` makes sure a file contains other lines than the one that matched. This is different from `! grep` which makes sure the file does not contain a line that matched. --- tests/test-restart-app.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/test-restart-app.yml') diff --git a/tests/test-restart-app.yml b/tests/test-restart-app.yml index 4c13a14..bc880a8 100644 --- a/tests/test-restart-app.yml +++ b/tests/test-restart-app.yml @@ -15,16 +15,16 @@ clever_restart_only: true post_tasks: - name: Check stubbed commands - command: "{{ item.cmd }}" + shell: "{{ item.cmd }}" ignore_errors: true vars: display: "{{ item.display }}" with_list: - cmd: "grep restart ../clever-commands" display: "Expected 'clever restart' command to be called" - - cmd: "grep -v deploy ../clever-commands" + - cmd: "! grep deploy ../clever-commands" display: "Expected 'clever deploy' command to NOT be called" - - cmd: "grep -v scale ../clever-commands" + - cmd: "! grep scale ../clever-commands" display: "Expected 'clever scale' command to NOT be called" register: tests_results - name: show results -- cgit v1.2.3