Uploaded image for project: 'Puppet Server'
  1. Puppet Server
  2. SERVER-390

Write acceptance test for "foreground" subcommand

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Done
    • None
    • None
    • None
    • None
    • Server Jade 2015-05-27

    Description

      We have acceptance tests for most of our subcommands, except "foreground". Sometime during a git operation we lost the change made to the logback.xml file that allowed for "foreground" to work (specifically, printing to the console). We didn't realize this immediately, and no tests failed, but our "foreground" command was broken.

      This ticket is for writing (or attempting) such a test. The challenge is calling "foreground" in a way that allows the test to both detect output on STDOUT but also be able to shut down the Server.

      IMPLEMENTATION IDEAS

      • Something simple like on(master, "puppetserver foreground" ... won't work because it won't return control to Beaker.
      • Redirecting to a file like on(master, "puppetserver foreground > output" ... will capture the output, but we won't be able to terminate the Server (in a reasonable way) at that point.
      • We might be able to spawn a child process to run "foreground" and then kill its STDIN in the hopes that this will cause the JVM to terminate, but we're thinking chances are pretty slim this is how the JVM will behave.
      • We might be able to run "foreground" via Ruby and then have access to its STDOUT and terminate it via object methods.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nwolfe Nate Wolfe
              Erik Dasher Erik Dasher
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support