azure-sdk-for-java icon indicating copy to clipboard operation
azure-sdk-for-java copied to clipboard

Enable the configuration of storage account and key in unit test

Open gcheng opened this issue 14 years ago • 3 comments

Currently no, to run the tests for table you need to change the account string in TableTestBase.java. If you guys would like to provide more information on how ongoing testing is going to be accomplished ( i.e. config, reporting etc) then we can modify our tests to fit that. For this release however we will continue to test as is so please let us know when a build is available,

thx

joe

From: Jason Cooke Sent: Wednesday, February 22, 2012 10:12 PM To: Joe Giardino; Jeff Irwin; Deepak Verma; Joost de Nijs; Jai Haridas; Metodi Mladenov; Jeff Wilcox Cc: Mohit Srivastava; Louis DeJardin Subject: RE: Shipping Java Tables

Can the unit tests be run without changing the test strings in the unit tests?

For our unit tests, they look at the env variables to modify the default strings. That makes it easy to run the unit tests on our CI server (an on testers’ machines).

Thanks, Jason

gcheng avatar Apr 04 '12 20:04 gcheng

Jason - can you look into this an propose a solution (like our environment variables) that the storage team could then use to fix this issue.

joostdenijs avatar Apr 05 '12 20:04 joostdenijs

One approach would be to alter the setup method in microsoft-azure-api/src/test/java/com/microsoft/windowsazure/services/table/client/TableTestBase.java to replace

        httpAcc = CloudStorageAccount.parse(CLOUD_ACCOUNT_HTTP);

with

        String tmp = CLOUD_ACCOUNT_HTTP;
        String accountName = System.getenv("table.accountName");
        if (accountName != null) {
            tmp = tmp.replace("[ACCOUNT NAME]", accountName);
        }
        String accountKey = System.getenv("table.accountKey");
        if (accountKey != null) {
            tmp = tmp.replace("[ACCOUNT KEY]", accountKey);
        }

        httpAcc = CloudStorageAccount.parse(tmp);

Then, if the environment variables are not set, it is a no-op.Those environment variables would make it consistant with what the Table service layer uses.

jcookems avatar May 15 '12 19:05 jcookems

This is fixed.

jcookems avatar Jan 29 '13 16:01 jcookems