Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method to disable individual tests #920

Open
duncangreene opened this issue Oct 25, 2024 · 5 comments
Open

Method to disable individual tests #920

duncangreene opened this issue Oct 25, 2024 · 5 comments
Assignees
Labels
framework Involves backend components (e.g framework or test modules)

Comments

@duncangreene
Copy link

Raising issue further to e-mail conversation with @jboddey.

Use case
User should be able to disable individual tests from running, either from test pack (preferred), or from module_config.json files.

I tried two methods as instructed.

  1. Deleting the highlighted block below from a test pack...

Image

...in this case the tests were still conducted, despite not being present in the test pack.

Image

  1. Adding "enabled": false to the module_config.json file...

Image

...yields the below in the report. I would maybe have expected a result of "Disabled" or for the tests to not appear at all, as opposed to "Feature Not Detected" (the detection didn't happen).

Image

These may warrant being two separate issues, but were discussed in the same thread of a need to disable individual tests. I can create a separate issue if wanted.

On a related point, it is noted that entire modules of tests can be disabled via the UI below, and so I'm unsure how the proposed disabling of individual tests may interact/interfere with the below in the UI. As an observation I would have thought test pack choice would override and even avoid the need to specify these options in the UI to some extent.

Image

@jboddey jboddey self-assigned this Oct 28, 2024
@jhughesbiot
Copy link
Collaborator

When you change a module configuration file, you need to rebuild the modules for it to take effect.

sudo cmd/build

This is not the recommended approach as it will disable these tests for all devices for all future tests and will also get overridden during upgrades.

The recommended approach is to modify the specific device configuration file.

For your example, if you navigate to the local/devices/< device folder >/device_config.json file and modify:

  "test_modules": {
    "protocol": {
      "enabled": true,
      "tests": {
        "protocol.valid_bacnet": {
          "enabled": false
        },
        "protocol.bacnet.version": {
          "enabled": false
        },
        "protocol.valid_modbus": {
          "enabled": false
        }
      }
    },

Which will give the following results:
Image

You should be able to expand this approach to any individual test. You do not need to itemize every test within a module, only the specific ones you want to modify.

@duncangreene
Copy link
Author

When you change a module configuration file, you need to rebuild the modules for it to take effect.

sudo cmd/build

This is not the recommended approach as it will disable these tests for all devices for all future tests and will also get overridden during upgrades.

@jhughesbiot thanks for the nod on this. Just confirming here for my own notes that changing module_config.json and then rebuild has the below effect.

Image

@duncangreene
Copy link
Author

@jhughesbiot Is there scope to get the functionality as discussed in method 1 in the original post working?

I would anticipate that the expected behaviour be that the exclusion of a test from a test pack should cause it not to run at all, nor appear in the test result list. What are your thoughts?

@jboddey
Copy link
Collaborator

jboddey commented Nov 6, 2024

@duncangreene We will go ahead with the disabling of tests if it is not included in the test pack.

@duncangreene
Copy link
Author

@duncangreene We will go ahead with the disabling of tests if it is not included in the test pack.

@jboddey Sounds good, a couple of supplementary questions if possible.

  1. If a test is not included in a test pack, will it not appear in the results at all (preferable), or will it appear in the results as 'disabled'?
  2. Will this functionality supersede/negate the need for the options in the UI below?
    Image

@jboddey jboddey added the framework Involves backend components (e.g framework or test modules) label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework Involves backend components (e.g framework or test modules)
Projects
None yet
Development

No branches or pull requests

3 participants