Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Running Tests

amarzavery edited this page Mar 5, 2015 · 19 revisions

Get Node.js Runtime, NPM, and Git

  1. From WebPI at http://azure.microsoft.com/en-us/downloads/, under the "Command-line tools" section download the windows install. This will install nodejs runtime 0.10.23, NPM and Azure Cross-Platform CommandLine Tools.
  2. Or from nodejs.org at http://www.nodejs.org/download/ for latest nodejs runtime/NPM only.
  3. Install Git for Windows from here.

Get Azure-Xplat-Cli

  • Create test folder and get xplat cli source code via Git. From Git Bash, type the following command at the test folder you just created.
  git clone https://github.com/Azure/azure-xplat-cli.git 

Then type command for the branch you like to run test (eg. dev branch here, if run on master branch, no need to run "git checkout dev" cmd below)

cd azure-xplat-cli
git checkout dev 
  • Run NPM package installation. At the same git bash console above, make sure all the npm packages installed success
    npm install 
  • Install xplat cli. In a command prompt, under the azure-xplat-cli directory execute the following command
npm install -g .

This will install the azure cli from the code base in the current directory in the global location. To verify the installation execute following commands

azure -v # It should display the current version number of xplat cli
azure -h # It should display the help for different commands supported by xplat cli

Azure Account Setup

Please click here for Setting up environment variables for running xplat cli tests

Run Test

Pre-requisite: Login using an organizational account

azure login -u $username

OR

Import the publish settings xml file (cert based credentials)

azure account import $path-to-publishsettings-file

Select a subscription from the available list. This subscription will be used for running live tests.

azure account list
azure account set $subscription-name-or-id
  1. Run all unit test. Run the following cmd at cmd console of test folder\azure-xplat-cli
npm test  
  1. If you want to run selective unit tests. Go to yourtestfolder\azure-xplat-cli\test, edit the testlist.txt, put "# " at the beginning the line for the unit test that need not run, save testlist.txt file, and run on the cmd prompt
npm test  

Note: For specifically running arm tests execute the following command on the command prompt

npm run unit-arm

To run docker vm create tests on windows make sure ssl agent is installed.