Hi, I'm trying to add some additional metadata abo...
# community-support
a
Hi, I'm trying to add some additional metadata about test results to records in the
other
column of the
elementary_test_results
table at test runtime, but I haven't been able to find any documentation about it. Is there some config key I can set that elementary will use in the post-hook to set values in the
other
column?
i
Hey @Adam Lopez 🙂 Can you please share an example of what additional metadata you would like to save?
a
Hi @Idan Shavit, I'm looking to persist runtime results of a suite of several test cases (implemented as a set of macros) from a single test. Right now the results are not granular (i.e. one record in
elementary_test_results
for all macros) but I'm looking to work around this by pushing granular results to the
other
field of the
elementary_test_results
record the interface looks like this for calling the test_suite:
Copy code
models:
  - name: my_model
    tests:
      - my_package.test_suite
ideally if you know of a way for me to call tests from within another test (i.e. test_suite) call a set of tests interally and have one record per test called in
elementary_test_results
that would be perfect, but I couldn't find a way to do this
i
Hey @Adam Lopez, so the
other
field is an internal field of elementary and it is not editable by the users, I can suggest using
run_query
to execute queries from your tests that can inset data to tables for example:
Copy code
{% test a_test() %}
  TEST
  .
  .
  .
  {% set sql_insert_query %}
    INSERT .....
  {% endset %}
  {% do dbt.run_query(sql_insert_query) %}
  .
  .
  .
  REST OF TEST
{% endtest %}
a
Thanks @Idan Shavit for the suggestion. another related question, how can I populate the
elementary_test_results.result_rows
field? I've tried setting the failed_result_rows_calc in the config block but the
result_rows
field stays null