Skip to main content

Run batches on Windows hosts with Jenkins

The windows runner sends each run of qa batch to a Windows host, as a build of a Jenkins job that runs the command it gets. Use it when your code only runs on Windows. To run your batches in a Jenkins pipeline instead, see CI integration.

Set up the Jenkins job​

  1. Start the QA-Board server with Jenkins credentials in its JENKINS_AUTH environment variable, so that it can start and follow builds: see the server's environment variables.

  2. Create a Jenkins job:

    • enable Trigger builds remotely, and note its token;

    • make it parameterized, with a String parameter named task: the command to run;

    • add a build step Execute Windows batch command:

      REM if the job needs shared drives
      net use \\server\share

      @echo "%task%"
      "%task%""
  3. Give the job to qa, in qaboard.yaml:

    qaboard.yaml
    runners:
    default: local
    jenkins:
    build_url: https://jenkins.kitefin.example/job/my-team/job/WindowsExecutor
    token: "1234"

    Or with the QA_RUNNERS_JENKINS_BUILD_URL and QA_RUNNERS_JENKINS_TOKEN environment variables.

The QA-Board server starts the builds with its Jenkins credentials. When qa has a token (QABOARD_TOKEN, or qa auth login), its user must be a developer of the project. Without a token, the server only starts the jobs listed in the project's qaboard.yaml (runners.jenkins.build_url, or a Jenkins integration), and not at all when the server requires tokens to send results (ingest.auth set to token). So with QA_RUNNERS_JENKINS_BUILD_URL set to another job, use a token.

caution

The runner is named windows, while its settings are under runners.jenkins. Set runners.default (e.g. to local): otherwise qa batch tries to use a runner named jenkins, which doesn't exist.

Send runs to Windows​

  • For one command: qa batch --runner windows my-batch.
  • For all batches: runners.default: windows in qaboard.yaml.
caution

A batch can't choose its runner yet: runner: windows in a batch doesn't work, the command line's runner (--runner or runners.default) always wins.