public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: kdevops@lists.linux.dev
Subject: Re: [RFT] fstests: add support to dynamically skip tests
Date: Fri, 15 Mar 2024 10:24:16 -0400	[thread overview]
Message-ID: <ZfRaEELWB_fs3G1q@manet.1015granger.net> (raw)
In-Reply-To: <20240314191247.3683717-1-mcgrof@kernel.org>

On Thu, Mar 14, 2024 at 12:12:46PM -0700, Luis Chamberlain wrote:
> Sometimes you just want to skip a few tests from the command line,
> example use case:
> 
> make fstests-baseline SKIP_TESTS="generic/002,generic/003"
> 
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
> ---
> 
> Please test. Works for me.

This works very nicely.

Tested-by: Chuck Lever <chuck.lever@oracle.com>


>  playbooks/roles/fstests/defaults/main.yml | 5 +++++
>  playbooks/roles/fstests/tasks/main.yml    | 9 +++++++++
>  workflows/fstests/Makefile                | 5 +++++
>  3 files changed, 19 insertions(+)
> 
> diff --git a/playbooks/roles/fstests/defaults/main.yml b/playbooks/roles/fstests/defaults/main.yml
> index b0d9e0da1732..1d14568a03d0 100644
> --- a/playbooks/roles/fstests/defaults/main.yml
> +++ b/playbooks/roles/fstests/defaults/main.yml
> @@ -15,6 +15,11 @@ dynamic_limit_tests:
>  
>  fstests_start_after: False
>  fstests_start_after_test: ""
> +
> +fstests_skip_tests_enable: False
> +fstests_skip_tests: ""
> +fstests_skip_tests_args: ""
> +
>  fstests_initial_baseline: False
>  fstests_initial_baseline_args: ""
>  
> diff --git a/playbooks/roles/fstests/tasks/main.yml b/playbooks/roles/fstests/tasks/main.yml
> index b76536ecf4f6..386dc11014c8 100644
> --- a/playbooks/roles/fstests/tasks/main.yml
> +++ b/playbooks/roles/fstests/tasks/main.yml
> @@ -895,6 +895,13 @@
>      - fstests_start_after|bool
>    tags: [ 'oscheck', 'fstests', 'run_tests', 'checktime' ]
>  
> +- name: Expand tests to skip tests dynamically passed on the command line
> +  set_fact:
> +    fstests_skip_tests_args: "-e {{ fstests_skip_tests }}"
> +  when:
> +    - fstests_skip_tests_enable|bool
> +  tags: [ 'oscheck', 'fstests', 'run_tests', 'checktime' ]
> +
>  - name: Verify use of START_AFTER
>    tags: [ 'oscheck', 'fstests', 'run_tests', 'kdevops_fstests_setup', 'install' , 'generate-fstests-config' ]
>    ansible.builtin.fail:
> @@ -1077,6 +1084,7 @@
>    vars:
>      fstests_section: "{{ ansible_host | regex_replace(kdevops_host_prefix + '-') | regex_replace('-dev') | regex_replace('-', '_') }}"
>      initial_baseline_expunges: "{{ fstests_initial_baseline_args | trim }}"
> +    skip_tests_args: "{{ fstests_skip_tests_args | trim }}"
>    tags: [ 'oscheck', 'fstests', 'run_tests' ]
>    become: yes
>    become_flags: 'su - -c'
> @@ -1091,6 +1099,7 @@
>        {{ oscheck_extra_args }}
>        {{ all_limit_tests }}
>        {{ initial_baseline_expunges }}
> +      {{ skip_tests_args }}
>    ignore_errors: yes
>    no_log: True
>    args:
> diff --git a/workflows/fstests/Makefile b/workflows/fstests/Makefile
> index 734c8837d302..cb09ef26f1aa 100644
> --- a/workflows/fstests/Makefile
> +++ b/workflows/fstests/Makefile
> @@ -144,6 +144,11 @@ DYNAMIC_RUNTIME_VARS += , "fstests_start_after": True
>  DYNAMIC_RUNTIME_VARS += , "fstests_start_after_test": "$(START_AFTER)"
>  endif
>  
> +ifneq (,$(SKIP_TESTS))
> +DYNAMIC_RUNTIME_VARS += , "fstests_skip_tests_enable": True
> +DYNAMIC_RUNTIME_VARS += , "fstests_skip_tests": "$(SKIP_TESTS)"
> +endif
> +
>  ifeq (y,$(CONFIG_DEVCONFIG_ENABLE_SYSTEMD_JOURNAL_REMOTE))
>  FSTESTS_BASELINE_EXTRA += journal-ln
>  endif
> -- 
> 2.43.0
> 

-- 
Chuck Lever

  reply	other threads:[~2024-03-15 14:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-14 19:12 [RFT] fstests: add support to dynamically skip tests Luis Chamberlain
2024-03-15 14:24 ` Chuck Lever [this message]
2024-03-15 18:25   ` Luis Chamberlain

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=ZfRaEELWB_fs3G1q@manet.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=kdevops@lists.linux.dev \
    --cc=mcgrof@kernel.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox