Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2c03d53
trigger live tests
sima-zhu Dec 11, 2019
cfb7874
hide failed ones
sima-zhu Dec 11, 2019
4e3a367
Move to live mode
sima-zhu Dec 11, 2019
e988212
Fixed bug
sima-zhu Dec 11, 2019
9cfff31
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-java …
sima-zhu Dec 11, 2019
b2050dd
Enable per test timeout and enable debug
sima-zhu Dec 11, 2019
14fed60
Change pipeline always publish the results
sima-zhu Dec 11, 2019
c15768d
Fixed queue and file tests
sima-zhu Dec 11, 2019
ddf850d
Fixed queue and file tests, adjust name length
sima-zhu Dec 11, 2019
45bfac3
Setup memory for storage large tests.
sima-zhu Dec 12, 2019
64e29e7
Fixed the json file
sima-zhu Dec 12, 2019
763d033
Logging level to debug
sima-zhu Dec 12, 2019
bf49a16
Fixed more playback issue
sima-zhu Dec 12, 2019
223e321
literally add memory for testing
sima-zhu Dec 12, 2019
42e507b
change timeout
sima-zhu Dec 12, 2019
0bff86a
fixed memory
sima-zhu Dec 12, 2019
7154600
Update tests.yml
sima-zhu Dec 12, 2019
7297142
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-java …
sima-zhu Dec 12, 2019
dae0972
Merge branch 'live_test' of https://github.com/sima-zhu/azure-sdk-for…
sima-zhu Dec 12, 2019
2ada695
Update client.yml
sima-zhu Dec 12, 2019
0afd6d3
Update client.yml
sima-zhu Dec 12, 2019
08a843a
Update archetype-sdk-tests-pre-sdk.yml
sima-zhu Dec 12, 2019
32a40b9
Update archetype-sdk-tests-pre-sdk.yml
sima-zhu Dec 12, 2019
1bf5f4e
Revert all unnecessary one back
sima-zhu Dec 12, 2019
6dca442
Update client.yml
sima-zhu Dec 12, 2019
4809d99
Update client.yml
sima-zhu Dec 12, 2019
239a1a1
Merge branch 'live_test' of https://github.com/sima-zhu/azure-sdk-for…
sima-zhu Dec 12, 2019
976e60d
Revert the test to original setting
sima-zhu Dec 12, 2019
424a00a
Added back the missing import
sima-zhu Dec 12, 2019
5c43d6e
Rename to right account for test
sima-zhu Dec 12, 2019
c8e6c88
change storage to live mode
sima-zhu Dec 13, 2019
3a527b8
More fix on live mode
sima-zhu Dec 13, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
condition: succeededOrFailed()
inputs:
mergeTestResults: true
testRunTitle: 'Live tests for ${{ parameters.PomFilePath }}'
testRunTitle: 'Live tests for ${{ parameters.PomFilePath }}'
2 changes: 1 addition & 1 deletion eng/pipelines/templates/jobs/archetype-sdk-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ parameters:
jdkVersionOption: '$(JavaVersion)'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'test'
goals: 'test'
TestResultsFiles: ''

jobs:
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/templates/variables/globals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ variables:
LoggingOptions: '-Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
MemoryOptions: '-Xmx3072m'
#Agent.Source.Git.ShallowFetchDepth: 1
skipComponentGovernanceDetection: true
skipComponentGovernanceDetection: true
EmulatorMsiUrl: 'https://aka.ms/cosmosdb-emulator'
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,14 @@ class APISpec extends Specification {
}

static boolean liveMode() {
return setupTestMode() == TestMode.RECORD
return setupTestMode() == TestMode.LIVE
}

private StorageSharedKeyCredential getCredential(String accountType) {
String accountName
String accountKey

if (testMode == TestMode.RECORD) {
if (testMode != TestMode.PLAYBACK) {
accountName = Configuration.getGlobalConfiguration().get(accountType + "ACCOUNT_NAME")
accountKey = Configuration.getGlobalConfiguration().get(accountType + "ACCOUNT_KEY")
} else {
Expand Down Expand Up @@ -177,8 +177,8 @@ class APISpec extends Specification {
.httpClient(getHttpClient())
.httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS))

if (testMode == TestMode.RECORD) {
if (recordLiveMode) {
if (testMode != TestMode.PLAYBACK) {
if (!recordLiveMode) {
builder.addPolicy(interceptorManager.getRecordPolicy())
}

Expand Down Expand Up @@ -228,7 +228,7 @@ class APISpec extends Specification {
builder.addPolicy(policy)
}

if (testMode == TestMode.RECORD && recordLiveMode) {
if (testMode == TestMode.RECORD) {
builder.addPolicy(interceptorManager.getRecordPolicy())
}

Expand All @@ -241,7 +241,7 @@ class APISpec extends Specification {

HttpClient getHttpClient() {
NettyAsyncHttpClientBuilder builder = new NettyAsyncHttpClientBuilder()
if (testMode == TestMode.RECORD) {
if (testMode != TestMode.PLAYBACK) {
builder.wiretap(true)

if (Boolean.parseBoolean(Configuration.getGlobalConfiguration().get("AZURE_TEST_DEBUGGING"))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ class APISpec extends Specification {
}

static boolean liveMode() {
return setupTestMode() == TestMode.RECORD
return setupTestMode() == TestMode.LIVE
}

private StorageSharedKeyCredential getCredential(String accountType) {
String accountName
String accountKey

if (testMode == TestMode.RECORD) {
if (testMode != TestMode.PLAYBACK) {
accountName = Configuration.getGlobalConfiguration().get(accountType + "ACCOUNT_NAME")
accountKey = Configuration.getGlobalConfiguration().get(accountType + "ACCOUNT_KEY")
} else {
Expand Down Expand Up @@ -194,7 +194,7 @@ class APISpec extends Specification {

HttpClient getHttpClient() {
NettyAsyncHttpClientBuilder builder = new NettyAsyncHttpClientBuilder()
if (testMode == TestMode.RECORD) {
if (testMode != TestMode.PLAYBACK) {
builder.wiretap(true)

if (Boolean.parseBoolean(Configuration.getGlobalConfiguration().get("AZURE_TEST_DEBUGGING"))) {
Expand Down Expand Up @@ -222,7 +222,7 @@ class APISpec extends Specification {
builder.addPolicy(policy)
}

if (testMode == TestMode.RECORD && recordLiveMode) {
if (testMode == TestMode.RECORD) {
builder.addPolicy(interceptorManager.getRecordPolicy())
}

Expand All @@ -244,7 +244,7 @@ class APISpec extends Specification {
builder.addPolicy(policy)
}

if (testMode == TestMode.RECORD && recordLiveMode) {
if (testMode == TestMode.RECORD) {
builder.addPolicy(interceptorManager.getRecordPolicy())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,18 @@ import reactor.core.publisher.Mono
import spock.lang.Requires
import spock.lang.Shared
import spock.lang.Specification
import spock.lang.Timeout

import java.nio.ByteBuffer
import java.nio.channels.AsynchronousFileChannel
import java.nio.charset.Charset
import java.nio.charset.StandardCharsets
import java.time.Duration
import java.time.OffsetDateTime
import java.util.concurrent.TimeUnit
import java.util.function.Supplier

@Timeout(value = 5, unit = TimeUnit.MINUTES)
class APISpec extends Specification {
@Shared
ClientLogger logger = new ClientLogger(APISpec.class)
Expand Down Expand Up @@ -141,6 +144,8 @@ class APISpec extends Specification {
alternateCredential = getCredential(SECONDARY_STORAGE)
blobCredential = getCredential(BLOB_STORAGE)
premiumCredential = getCredential(PREMIUM_STORAGE)
// The property is to limit flapMap buffer size of concurrency
// in case the upload or download open too many connections.
System.setProperty("reactor.bufferSize.x", "16")
System.setProperty("reactor.bufferSize.small", "100")
}
Expand All @@ -154,10 +159,9 @@ class APISpec extends Specification {
this.testName = fullTestName.substring(0, substringIndex)
this.interceptorManager = new InterceptorManager(className + fullTestName, testMode)
this.resourceNamer = new TestResourceNamer(className + testName, testMode, interceptorManager.getRecordedData())
// The property is to limit flapMap buffer size of concurrency
// in case the upload or download open too many connections.

// If the test doesn't have the Requires tag record it in live mode.
recordLiveMode = specificationContext.getCurrentIteration().getDescription().getAnnotation(Requires.class) == null
recordLiveMode = specificationContext.getCurrentIteration().getDescription().getAnnotation(Requires.class) != null

primaryBlobServiceClient = setClient(primaryCredential)
primaryBlobServiceAsyncClient = getServiceAsyncClient(primaryCredential)
Expand Down Expand Up @@ -206,14 +210,14 @@ class APISpec extends Specification {
}

static boolean liveMode() {
return setupTestMode() == TestMode.RECORD
return setupTestMode() == TestMode.LIVE
}

private StorageSharedKeyCredential getCredential(String accountType) {
String accountName
String accountKey

if (testMode == TestMode.RECORD) {
if (testMode == TestMode.RECORD || testMode == TestMode.LIVE) {
accountName = Configuration.getGlobalConfiguration().get(accountType + "ACCOUNT_NAME")
accountKey = Configuration.getGlobalConfiguration().get(accountType + "ACCOUNT_KEY")
} else {
Expand Down Expand Up @@ -242,8 +246,8 @@ class APISpec extends Specification {
.endpoint(String.format(defaultEndpointTemplate, primaryCredential.getAccountName()))
.httpClient(getHttpClient())

if (testMode == TestMode.RECORD) {
if (recordLiveMode) {
if (testMode != TestMode.PLAYBACK) {
if (testMode == TestMode.RECORD) {
builder.addPolicy(interceptorManager.getRecordPolicy())
}
// AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET
Expand Down Expand Up @@ -290,7 +294,7 @@ class APISpec extends Specification {
builder.addPolicy(policy)
}

if (testMode == TestMode.RECORD && recordLiveMode) {
if (testMode == TestMode.RECORD) {
builder.addPolicy(interceptorManager.getRecordPolicy())
}

Expand All @@ -310,7 +314,7 @@ class APISpec extends Specification {
.endpoint(endpoint)
.httpClient(getHttpClient())

if (testMode == TestMode.RECORD && recordLiveMode) {
if (testMode == TestMode.RECORD) {
builder.addPolicy(interceptorManager.getRecordPolicy())
}

Expand All @@ -323,7 +327,7 @@ class APISpec extends Specification {
.blobName(blobName)
.httpClient(getHttpClient())

if (testMode == TestMode.RECORD && recordLiveMode) {
if (testMode == TestMode.RECORD) {
builder.addPolicy(interceptorManager.getRecordPolicy())
}

Expand All @@ -341,7 +345,7 @@ class APISpec extends Specification {
.snapshot(snapshotId)
.httpClient(getHttpClient())

if (testMode == TestMode.RECORD && recordLiveMode) {
if (testMode == TestMode.RECORD) {
builder.addPolicy(interceptorManager.getRecordPolicy())
}

Expand All @@ -357,7 +361,7 @@ class APISpec extends Specification {
builder.addPolicy(policy)
}

if (testMode == TestMode.RECORD && recordLiveMode) {
if (testMode == TestMode.RECORD) {
builder.addPolicy(interceptorManager.getRecordPolicy())
}

Expand All @@ -370,7 +374,7 @@ class APISpec extends Specification {
.blobName(blobName)
.httpClient(getHttpClient())

if (testMode == TestMode.RECORD && recordLiveMode) {
if (testMode == TestMode.RECORD) {
builder.addPolicy(interceptorManager.getRecordPolicy())
}

Expand All @@ -386,7 +390,7 @@ class APISpec extends Specification {
builder.sasToken(sasToken)
}

if (testMode == TestMode.RECORD && recordLiveMode) {
if (testMode == TestMode.RECORD) {
builder.addPolicy(interceptorManager.getRecordPolicy())
}

Expand All @@ -395,7 +399,7 @@ class APISpec extends Specification {

HttpClient getHttpClient() {
NettyAsyncHttpClientBuilder builder = new NettyAsyncHttpClientBuilder()
if (testMode == TestMode.RECORD) {
if (testMode == TestMode.RECORD || testMode == TestMode.LIVE) {
builder.wiretap(true)

if (Boolean.parseBoolean(Configuration.getGlobalConfiguration().get("AZURE_TEST_DEBUGGING"))) {
Expand Down Expand Up @@ -728,7 +732,7 @@ class APISpec extends Specification {

// Only sleep if test is running in live mode
def sleepIfRecord(long milliseconds) {
if (testMode == TestMode.RECORD) {
if (testMode != TestMode.PLAYBACK) {
sleep(milliseconds)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1811,6 +1811,7 @@ class BlobAPITest extends APISpec {

when:
def undeleteHeaders = bc.undeleteWithResponse(null, null).getHeaders()

bc.getProperties()

then:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"networkCallRecords" : [ {
"Method" : "PUT",
"Uri" : "https://azstoragesdkaccount.file.core.windows.net/filesastestsaccountsasnetworkcreatedeleteshare08729af32?restype=share&sv=2019-02-02&ss=f&srt=sco&se=2019-12-13T00%3A30%3A35Z&sp=rdc&sig=REDACTED",
"Headers" : {
"x-ms-version" : "2019-02-02",
"User-Agent" : "azsdk-java-azure-storage-file-share/12.1.0-beta.1 (11.0.4; Windows 10 10.0)",
"x-ms-client-request-id" : "6ae824aa-99d1-494a-add2-50cdfc391a91"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"ETag" : "0x8D77E9A824ECF5D",
"Last-Modified" : "Thu, 12 Dec 2019 00:30:37 GMT",
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "201",
"x-ms-request-id" : "6b0eae91-601a-00e1-3483-b0d703000000",
"Date" : "Thu, 12 Dec 2019 00:30:37 GMT",
"x-ms-client-request-id" : "6ae824aa-99d1-494a-add2-50cdfc391a91"
},
"Exception" : null
}, {
"Method" : "DELETE",
"Uri" : "https://azstoragesdkaccount.file.core.windows.net/filesastestsaccountsasnetworkcreatedeleteshare08729af32?restype=share&sv=2019-02-02&ss=f&srt=sco&se=2019-12-13T00%3A30%3A35Z&sp=rdc&sig=REDACTED",
"Headers" : {
"x-ms-version" : "2019-02-02",
"User-Agent" : "azsdk-java-azure-storage-file-share/12.1.0-beta.1 (11.0.4; Windows 10 10.0)",
"x-ms-client-request-id" : "ebca1182-1725-4bb6-a52e-823b74de6642"
},
"Response" : {
"x-ms-version" : "2019-02-02",
"Server" : "Windows-Azure-File/1.0 Microsoft-HTTPAPI/2.0",
"retry-after" : "0",
"Content-Length" : "0",
"StatusCode" : "202",
"x-ms-request-id" : "6b0eae94-601a-00e1-3583-b0d703000000",
"Date" : "Thu, 12 Dec 2019 00:30:37 GMT",
"x-ms-client-request-id" : "ebca1182-1725-4bb6-a52e-823b74de6642"
},
"Exception" : null
} ],
"variables" : [ "filesastestsaccountsasnetworkcreatedeleteshare1326282b1", "2019-12-12T00:30:35.715121400Z", "filesastestsaccountsasnetworkcreatedeleteshare08729af32" ]
}
Loading