Skip to content

Test Guide on Window

xuezhai edited this page Jun 11, 2013 · 9 revisions

Get Node.js Runtime, NPM, and Git

  1. From WebPI at http://www.windowsazure.com/en-us/downloads/?sdk=node, which will install nodejs runtime 0.6.20, NPM, Azure Powershell Tool and IISNode.
  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 SDK for Node

  1. Create test folder and get Node SDK source code via Git. From Git Bash, type the following command at the test folder you just created.
  git clone https://github.com/WindowsAzure/azure-sdk-for-node.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-sdk-for-node 
git checkout dev 
  1. Run NPM package installation. At the same git bash console above, make sure all the npm packages installed success
    npm install 

Azure Account Setup

Launch cmd console as admin at your test folder\azure-sdk-for-node, at the cmd console, run the following:

set AZURE_APNS_CERTIFICATE_FILE=C:\test\cert2\yourpfxtfile.pfx 
set AZURE_APNS_CERTIFICATE_KEY=your certificate key
set AZURE_CERTIFICATE_FILE=C:\test\cert2\yourcertificatefile.cer 
set AZURE_CERTIFICATE_KEY_FILE=C:\test\cert2\yourcertificatefile.pfx 
set AZURE_SERVICEBUS_ACCESS_KEY=p5Td17PUrpwH4bWJOMT7... 
set AZURE_SERVICEBUS_ISSUER=owner 
set AZURE_SERVICEBUS_NAMESPACE=your servicebus namespace 
set AZURE_STORAGE_ACCESS_KEY=+qVg/q/K3DVUsdISEaelqwdbW+eJHdB6ZQt+v+qRqSR....
set AZURE_STORAGE_ACCOUNT=yourstorageaccountname
set AZURE_STORAGE_DNS_SUFFIX=core.windows.net 
set AZURE_SUBSCRIPTION_ID=6cf77b23-e09d-42...
set AZURE_MANAGEMENT_HOST=management.core.windows.net
set AZURE_SQL_TEST_LOCATION=US West 
set AZURE_SQL_DNS_SUFFIX=core.windows.net
set AZURE_WNS_PACKAGE_SID=yourWNSPackageSID
set AZURE_WNS_SECRET_KEY=yourWNSkey
set AZURE_GCM_KEY=yourGCMKey
set NOCK_OFF=true 

Run Test

  1. Run all unit test. Run the following cmd at cmd console of test folder\azure-sdk-for-node
npm test  
  1. Run unit test one by one. Go to yourtestfolder\azure-sdk-for-node\test, edit the testlist.txt, put "# " at the beginning the line for the unit test that not need to run, save testlist.txt file, run cmd
npm test  
  1. Run sample test. Make sure the compute emulator and storage emulator are started, and go to yourtestfolder\azure-sdk-for-node\examples\blobuploader, run
node server.js 
If any npm package missed, just run npm install to install the package (e.g. following is the cmd to install the express npm package most the example may depend on), then run "node server.js" again to start the server.
npm install express 
When the web server is up running, just go to the localhost to test it through the web browser (e.g.

http://localhost:1337 for blobuploader) to make sure the web site function as expected. Repeat the above step for examples\myevents, and examples\tasklist