RunCommand

The RunCommand tester allows for specifying directly the command line to run for a test. This can be done to run a python script, to run additional commands in addition to the moose executable, or any other command that fits in a command line input. The syntax of the command follows the bash syntax, with regards to running multiple commands on the same line for example.

Options

Test configuration options are specified in the tests file.

  • command: The command line to execute for this test

  • test_name: The name of the test - populated automatically

Other test commands & restrictions may be found in the TestHarness documentation.

Example test configuration in MOOSE test suite

In this example, RunCommand tests are ran after RunApp tests to run a custom Python script to postprocess the output of the PerfGraphReporter.

[Tests]
  design = 'PerfGraphReporter.md'
  issues = '#16256'

  [test]
    requirement = 'The system shall include the ability to report performance information'

    [run]
      type = 'RunApp'
      input = 'perf_graph_reporter.i'
      detail = 'in JSON format'
    []
    [verify]
      type = RunCommand
      command = 'python3 verify_perf_graph_reporter.py'
      prereq = test/run
      detail = 'and shall provide a tool to post process said information'
    []
  []

  [recover_initial]
    type = 'RunApp'
    input = 'perf_graph_reporter_recover.i'
    cli_args = '--test-checkpoint-half-transient Outputs/checkpoint=true'
    recover = false

    requirement = 'The system shall include the ability to serialize report performance information with the recover system'
  []

  [recover]
    requirement = 'The system shall include the ability to report performance information from a recovered solve'
    [run]
      type = 'RunApp'
      input = 'perf_graph_reporter_recover.i'
      cli_args = '--recover --recoversuffix cpr'
      prereq = recover_initial
      recover = false
      detail = 'in JSON format'
    []
    [verify]
      type = RunCommand
      command = 'python3 verify_perf_graph_reporter.py recover'
      prereq = recover/run
      detail = 'and shall provide a tool to post process said information'
    []
  []
[]
(contrib/moose/test/tests/reporters/perf_graph_reporter/tests)