Launchers / Automated tests

Git Launcher (git.jar)

The git launcher allows getting files from a Git repository.
The launchers allows to:
  • Get all files from an https:// or git:// repository
  • Manage this as a test, hence include it into a test campaign
This is useful when all of your tests scripts, codes and data are versioned through git.
This way, you can get all of the artifacts before executing your tests. Doing so, you are always sure to run the latest tests with up-to-date test data.
this also allows you to benefit from on-the-spot test servers that you can provision using vagrant or the likes
Note: we also have a launcher that is based on windows(TM) or Linux shell script interpreting arguments. But we recommend using this more specialized launcher for GIT
Latest test : On Windows 10-17134, git 2.17.1.windows.2
This version is initial (v1.0)

Configuration

The git.xml file is just a template and must NOT be edited. It's used by the system to dynamically build the form that the user will be able to fill in from the GUI when creating a custom execution configuration.

Parameter Description
Git
GIT executor path (no ending slash) This must indicate where your git execution is located - this enables you to avoid having to first modify you envrionment variables. This path MUST NOT include an ending slash.

Default value is: C:\Program Files\GIT\bin
Export destination path (no ending slash) This tells where the extracted files will be located after git get them. this should be the test root path for teh tests you will execute later on.
Default value is: C:\myTestRootPath
GIT repo URL (no ending slash) This tells where is the git repo. This can be anything that git supports (https, git ...)
Default value is: ="https://github.com/company/whatever.git

These values can be changed while creating the campaign session from XStudio.
Note about file path parameters:
Any parameter referring to a file or folder path (for instance Test root path) can be provided either using \ separator (if the tests are going to be executed on a Windows agent) or / separator (if the tests are going to be executed on a linux or MacOSX agent).

On windows, if you provide a path containing an OS-localizable folder such as C:\Program Files, always prefer the English version (i.e. NOT C:\Programmes if you're using a french-localized Windows) or the corresponding native environment variable (i.e. %PROGRAMFILES%).


Specific test attributes

It is possible to associate attributes to individual test. This launcher will recognize and use the following attributes:
  • com.xqual.git.username (only works with http and https)
  • com.xqual.git.password (only works with http and https)
  • com.xqual.git.revision
  • com.xqual.git.exportOrCheckout


com.xqual.git.username

Allows specifying the credential USERNAME to connect to your http or https git repositpory (if required) (see git documentation for this)
This is setting the <USERNAME> in the connection string (username:password@)
com.xqual.git.password

Allows specifying the credential PASSWORD to connect to your http or https git repositpory (if required) (see git documentation for this)
This is setting the <PASSWORD> in the connection string (username:password@)
com.xqual.git.revision

Allows specifying the branch and revision from which to extract file - if not provided we get from the master . (see git documentation for this)
This is setting the --branch flag in git
com.xqual.git.exportOrCheckout

Allows stating if we need to keep the files cloned or if this is an simple export. By default we recommend an export. (see git documentation for this)
The export is in fact a clone operation but we clean the hidden .git folder afterwards.

Process

1) The launcher will constitute and run the interpreter with the following templates:
<git exe path>\git clone [--branch <com.xqual.git.revision> ] [<com.xqual.git.username>:<com.xqual.git.password>@] "<GIT repo URL (no ending slash)>/" "<Export destination path (no ending slash)>/" --verbose --single-branch --depth 1
Note: by only getting depth 1 , this limits the time and volume of data as we only need the latest test in general
2) all report files will be attached to the results if found
3) The launcher parses the specific gitLogFile.txt trace file and use it to provide summarized information back to the testers


Permissions

WARNING: if you're running your tests on Windows, it may be required to run the tests as administrator.
Having an account with Administrators permissions may even not be enough in some cases (especially if you're using Windows 10) and you may need to disable completely the UAC (User Access Control) on your computer.
To do so:
  • Press the Windows + R key combination
  • Type in regedit
  • Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
  • In the right-side pane, look for EnableLUA and set the value 0
  • Close the registry editor
  • Restart your computer

Debug

If your tests are not executed correctly or are reporting only failures, this is very likely because your configuration is incorrect or because you used a wrong naming convention for your tests and test cases.

The best way to quickly find out what's wrong is to look at the traces generated by XStudio (or XAgent).
The traces always include the detailed description of what the launcher performs (command line execution, script execution, API calling etc.) to run a test case. So, if you experiment some problems, the first thing to do is to activate the traces and look at what's happening when you run your tests.

Then, try to execute manually in a cmd box the exact same commands.
This will normally fail the same way.
At this point, you needs to figure out what has to be changed in these commands in order to have them run properly.

When you have something working, compare these commands to what's described in the Process chapter above. This will tell you exactly what you need to change.

Most of the time, this is related to:
  • some incorrect values in some parameters of your configuration,
  • the name of your tests,
  • the name of your test cases,
  • the canonical path of your tests