View Source

h1. Situation
Set up the configuration so that it can ask user for below settings when manually triggered:
# User can select either _Smoke Test Mode_ or _Acceptance Test Mode_.
# When _Smoke Test Mode_ is selected, user can select _Component A_ and/or _Component B_ to test, and can select whether or not to run integration tests.
# When _Acceptance Test Mode_ is selected, user can continue to select _Component C_ and/or _Component D_ to test.
# User can optionally select which test suite to run.
# User can optionally select which test case to run in the selected test suite.

h1. Demonstration
# Open [this configuration|] and hit the run button.
# A build option screen will be presented with desired settings. Make some selection and hit the OK button. Please note that when a test suite is selected, all test cases belonging to that test suite will be displayed for choice.
# Wait for some time for the build to finish. Check the [step status|] screen, and you will find that the test step has been executed on the nodes you specified in the build option screen.
# Open [build log|] and check output of the test step. For demonstration purpose, the specified test setting and its options are printed in the log correctly.

h1. Resolution
# [Create a custom plugin|plugin tutorials] implementing the PromptBeanProvider extension point to provider your own build option bean. You may start with the sample plugin _com.example.promptbean_ in directory _<QuickBuild server install dir>/dev/plugin/samples_, and modify various bean classes as necessary. Refer to [bean editor] on how to annotate your beans for editing purpose. This tutorial uses the sample plugin directly.
# Stop QuickBuild, deploy your plugin to QuickBuild, and then start QuickBuild. Refer to [plugin tutorials] on how to do this.
# Define a variable with prompt setting set to _prompt for bean input_, and choose the bean you provided in your plugin. In this tutorial, we choosed the _Example Prompt Bean_ as demonstrated [here|].
# Please note that we also specified default value of the bean by creating the bean object with groovy, assigning default values to its fields, and convert it to a string. This default bean will be used to populate the variable when the build is not manually triggered (ie. triggered via schedule).
# Definition of the [test step|] retrieves the bean via the variable and traverses the object graph to print interesting information.