Hello <@U088WCP3B4P> ! Is it possible to exclude a...
# ask-elementary-ai
a
Hello @kapa.ai ! Is it possible to exclude a specific tests from being shown in the HTML report ? While still being able to send it to Slack.
k
A message from kapa.ai
I'm sorry, but according to the available knowledge sources, it is not currently possible to exclude specific tests from being shown in the HTML report generated by Elementary. The selectors (such as by tag or model) can be used to filter the summary notification sent to Slack, but the full HTML report will always include all tests from the invocation. You can, however, send only the summary to Slack (without the HTML attachment) using the --disable html_attachment flag, but this does not filter the content of the HTML report itself. Filtering the actual report content by test, tag, or model is not supported at this time [Send report summary notification to Slack](https://docs.elementary-data.com/oss/guides/share-observability-report/send-report-summary) [Slack discussion: sensitive tests in report](https://slack.com/archives/C02CTC89LAX/p1696506753295779).
a
@kapa.ai Hmmm do you know then if there's a way i can avoid having the elementary hook get the results from that specific test ? Like if i run it separately from other tests, can i disable the hook for that specific test for example ? But i guess then i won't be able to send it to Slack...
k
A message from kapa.ai
Based on the knowledge sources, there is no built-in way to have the Elementary hooks selectively ignore results from a specific test while still running for others. The hooks operate at the run/invocation level, not at the individual test level. You can disable the Elementary hooks for an entire run by setting variables such as
disable_tests_results
,
disable_run_results
, etc., either in your
dbt_project.yml
or by passing them as command-line variables. For example:
Copy code
yaml vars:   disable_tests_results: true
or
Copy code
bash dbt test --vars '{"disable_tests_results": true}'
However, this will disable the collection of test results for the entire run, not just for a specific test. There is no documented way to disable the hook for only a single test within a run. If you run the test separately with the hooks disabled, then, as you mentioned, you also won't be able to send its results to Slack, since Elementary won't collect or process its results in that case [FAQ: Can I disable the on-run-end hooks or results uploading?](https://docs.elementary-data.com/oss/general/faq) [Slack discussion: disabling hooks for specific runs](https://slack.com/archives/C02CTC89LAX/p1677660628796219). If you need to filter which test results are sent to Slack, you can use selectors (e.g., by tag) when running the
edr monitor
command, but this only affects the Slack alert, not the data Elementary collects or the HTML report content [Slack discussion: filter alerts using selectors](https://slack.com/archives/C02CTC89LAX/p1673992965388019). In summary: you cannot disable Elementary hooks for a specific test only; disabling is at the run level, and if you disable hooks for a run, no results (including for Slack) will be collected for that run.