eclipse-archived / codewind

The official repository of the Eclipse Codewind project
https://codewind.dev
Eclipse Public License 2.0
114 stars 44 forks source link

downloadCwctl() automated test function will always download master, should use branch version #996

Open jgwest opened 5 years ago

jgwest commented 5 years ago

The downloadCwctl() function -- which is used to download the Codewind CLI when running Tempest automated tests -- is currently programmed to only grab the installer from the master branch. Once we shift to running tests on product branches, this installer version will not correspond to the product version being tested.

So we should shift to using the appropriate installer branch, depending on whether it is a PR build, a product build, or a local (developer's machine) build.

If running outside a Jenkins pipeline, the following will get the current branch:

BRANCH_NAME=`git rev-parse --abbrev-ref HEAD`

If running in a Jenkins pipeline, the following will be automatically be set by the Jenkins plugins we are using in Eclipse CBI:

BRANCH_NAME (local branch)
CHANGE_TARGET (branch of the pull request, if the pipeline is running in a PR)
tetchel commented 5 years ago

here's how we do it in vs code, more or less the same as what jonathan put above https://github.com/eclipse/codewind-vscode/blob/master/Jenkinsfile#L50