Contents

rbld

As a CLI user I want to interfere with system via main script called rbld

Scenario: rbld unknown_command fails with error

  • Given I run `rbld unknown_command`
  • Then it should fail with:
    ERROR: Unknown command: unknown_command

Scenario: rbld help unknown_command fails with error

  • Given I run `rbld help unknown_command`
  • Then it should fail with:
    ERROR: Unknown command: unknown_command

Scenario: there is no log by default

  • Given I run `rbld`
  • Then the output should not contain "INFO: ARGV:"

Scenario: log is enabled by RBLD_LOG_LEVEL environment variable

  • Given I set the environment variables to:
    variablevalue
    RBLD_LOG_LEVELdebug
  • When I run `rbld`
  • Then the output should contain "INFO: ARGV:"

Scenario Outline: various log levels supported

  • Given I set the environment variables to:
    variablevalue
    RBLD_LOG_LEVEL<level>
  • When I run `rbld`
  • Then the output <should or should not> contain "INFO: ARGV:"

Examples:

levelshould or should not
debugshould
infoshould
warnshould not
errorshould not
fatalshould not
unknownshould not

Scenario: log is redirected to file by RBLD_LOG_FILE environment variable

  • Given I set the environment variables to:
    variablevalue
    RBLD_LOG_LEVELdebug
    RBLD_LOG_FILErbld.log
  • When I run `rbld`
  • Then the output should not contain "INFO: ARGV:"
  • And a file "rbld.log" should contain "INFO: ARGV:"

Scenario: stack backtrace is not printed on incorrect command line

  • When I run `rbld run --wrong-opt`
  • Then the output should not contain "<main>"

Scenario: stack backtrace of exceptions is logged as FATAL

  • Given I set the environment variables to:
    variablevalue
    RBLD_LOG_LEVELfatal
  • When I run `rbld run --wrong-opt`
  • Then the output should match /FATAL.+rbld.+<main>/

Scenario: stack backtrace is not printed on signal

@skip-on-windows

  • When I send signal "INT" to rbld application
  • Then the output should not contain "<main>"
  • And the output should contain "ERROR: Command execution was terminated."

Scenario: stack backtrace of signal is logged as FATAL

@skip-on-windows

  • Given I set the environment variables to:
    variablevalue
    RBLD_LOG_LEVELfatal
  • When I send signal "INT" to rbld application
  • Then the output should match /FATAL.+rbld.+<main>/

Source: features/cli/rbld.feature at commit 44889ff6, Rebuild (Apache-2.0 license).