Working with VSTS personal branches

Reading This Manual

Copying all content from this file and pasting it at https://jbt.github.io/markdown-editor/ will not display images and gif animations since they are stored locally within the repository. It is strongly recommended to read this document inside Atom text editor using Ctrl + Shift + M to display the rendered preview.

Introduction

Use Git and VSTS to save your work and coordinate code changes across your team.

How to work with VSTS personal branches:

  1. Create a branch for the changes that you plan to make, and name it accordingly.
  2. Add your branch to the Post-commit build definition trigger.
  3. After working changes are committed, Push your branch to the remote repository.

1. Create a branch for the changes that you plan to make, and name it accordingly

Go to Code -> Branches. Click New branch and create branch under the following convention: [firstname].[lastname]. Select the created branch to work with it.

2. Add your branch to the Post-commit build definition trigger

Go to the Build and Release -> Build -> All Definitions -> Post-commit Build -> Edit -> Triggers. Add your branch to Branch Filters. Click Save and queue -> Save.

3. After working changes are committed, Push your branch to the remote repository

Share changes made in commits and branch using the push command. Push your branch to the remote repository, where Git takes the commits and adds them to an existing branch on the remote or creates a new branch with the same commits as your local branch.

If there are any conflicts between your local commits and the commits on the remote branch, you must first resolve these conflicts before you can push your changes. You should pull the changes from others first, resolve the conflicts and commit the changes, then reattempt the push.

Author: Dmitry Andreev

How to configure VSTS to use Espresso

Reading This Manual

Copying all content from this file and pasting it at https://jbt.github.io/markdown-editor/ will not display images and gif animations since they are stored locally within the repository. It is strongly recommended to read this document inside Atom text editor using Ctrl + Shift + M to display the rendered preview.

Introduction

Configure VSTS to use Espresso for UI tests.

1. Add a Gradle task

  • Go to the Build and Release -> Build -> All Definitions -> Gated Build -> Edit.
  • Click on Add Task.
  • Search for Gradle and click Add.

 

 

 

 

2. Configure the task

  • In the Display Name field, type in gradlew connectedAndroidTest.
  • In the Tasks field, type in connectedAndroidTest.
  • Click Save

 

3. Build

Now, when the Gated Build definition is run, VSTS will perform the UI tests.

These UI tests have been implemented using Espresso and the Green Coffee library and are located in the app/src/androidTest directory.

Author: Nahom Abi

Configure Microsoft Visual Studio Team Services to build and run unit tests against the Android application

Reading This Manual

Copying all content from this file and pasting it at https://jbt.github.io/markdown-editor/ will not display images and gif animations since they are stored locally within the repository. It is strongly recommended to read this document inside Atom text editor using Ctrl + Shift + M to display the rendered preview.

Introduction

Configure Microsoft Visual Studio Team Services to build and run unit tests against the Android application.

1. Setting up your workspace

Make sure to read working-with-VSTS-personal-branches manual first to configure your personal VSTS.

2. Configuring Unit Tests

Go to the Build and Release -> Build -> All Definitions -> Gated Build -> Edit.

We’ll need to tell VSTS how to run unit tests. Click on Add Task and search for Gradle and click Add.

Select the newly added task and look for the Tasks text field. In the field, replace build with a test.

VSTS can now run the .\gradlew test command which will run the tests added in task #331.

Click Save & queue -> Save.

3. Queue a build

Go to the Build and Release -> Build -> All Definitions -> Gated Build. Click Queue new build. Choose your branch from the Branch drop-down. Click Queue.

4. After the build is done,

You should see a build status and logs of the tests it ran.

If the test was successful, you will need to go to ./app/build/reports/tests/testDebugUnitTest/index.html to see the result.

Author: Nahom Abi