Skip to content

Commit

Permalink
Merge branch 'master' into 2874_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
praries880 authored Feb 25, 2019
2 parents 3b2c31a + c5c5497 commit aaa1d5e
Show file tree
Hide file tree
Showing 9 changed files with 140 additions and 99 deletions.
57 changes: 23 additions & 34 deletions .azure-pipelines/client.test.live.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
variables:
- group: KeyVault Test Secrets
- name: ARM_CLIENTID
value: $(java-keyvault-test-arm-client-id)
- name: ARM_CLIENTKEY
value: $(java-keyvault-test-arm-client-key)
- name: AZURE_BATCH_ACCOUNT
value: $(java-batch-test-account-name)
- name: AZURE_BATCH_ACCESS_KEY
value: $(java-batch-test-account-access-key)
- name: STORAGE_ACCOUNT_NAME
value: $(java-batch-test-storage-account-name)
- name: STORAGE_ACCOUNT_KEY
value: $(java-batch-test-storage-account-key)


jobs:

- job: 'LiveTest'

strategy:
Expand All @@ -24,29 +7,35 @@ jobs:
pomFilePath: './batch/data-plane/pom.xml'
AzureKeyVault:
pomFilePath: './keyvault/data-plane/pom.xml'

pool:
vmImage: 'vs2017-win2016'

# Adding -Dmaven.wagon.http.pool=false to the mvn command as a workaround to prevent build failures at maven artifacts downloading stage.
steps:
- bash: |
LOG_PARAMS='-Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
mvn test -Dmaven.wagon.http.pool=false -Dsurefire.rerunFailingTestsCount=3 $LOG_PARAMS -f $(pomFilePath)
displayName: 'Run Live Tests'
# Adding -Dmaven.wagon.http.pool=false to the mvn command as a workaround to prevent build failures at maven artifacts downloading stage.
- task: Maven@3
displayName: 'Run Live tests'
inputs:
mavenPomFile: $(pomFilePath)
options: '--batch-mode -Dmaven.wagon.http.pool=false -Dsurefire.rerunFailingTestsCount=3'
mavenOptions: '-Xmx3072m -Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.8'
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'test'
env:
ARM_CLIENTID: $(ARM_CLIENTID)
ARM_CLIENTKEY: $(ARM_CLIENTKEY)
ARM_CLIENTID: $(java-keyvault-test-arm-client-id)
ARM_CLIENTKEY: $(java-keyvault-test-arm-client-key)
AZURE_TEST_MODE: RECORD
AZURE_BATCH_ACCOUNT: $(AZURE_BATCH_ACCOUNT)
AZURE_BATCH_ACCESS_KEY: $(AZURE_BATCH_ACCESS_KEY)
STORAGE_ACCOUNT_KEY: $(STORAGE_ACCOUNT_KEY)
STORAGE_ACCOUNT_NAME: $(STORAGE_ACCOUNT_NAME)
AZURE_BATCH_ACCOUNT: $(java-batch-test-account-name)
AZURE_BATCH_ACCESS_KEY: $(java-batch-test-account-access-key)
STORAGE_ACCOUNT_KEY: $(java-batch-test-storage-account-key)
STORAGE_ACCOUNT_NAME: $(java-batch-test-storage-account-name)
AZURE_BATCH_ENDPOINT: https://servbatch.centralus.batch.azure.com

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/TEST-*.xml'


mergeTestResults: true
testRunTitle: 'Live tests for $(pomFilePath)'
108 changes: 59 additions & 49 deletions .azure-pipelines/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
trigger:
- master

variables:
DefaultOptions: '--batch-mode -Dmaven.wagon.http.pool=false'
LoggingOptions: '-Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'

jobs:
- job: 'Build'

Expand All @@ -13,37 +17,38 @@ jobs:
strategy:
matrix:
Java 8:
artifactDir: 'java-8'
mvnFlags: ''
javaVer: '1.8'
ArtifactName: 'packages'
ProfileFlag: ''
JavaVersion: '1.8'
Java LTS:
artifactDir: 'java-lts'
mvnFlags: '-Djava-lts'
javaVer: '1.11'
ArtifactName: 'java-lts-packages'
ProfileFlag: '-Djava-lts'
JavaVersion: '1.11'

steps:
- task: Maven@3
displayName: 'Build and Package'
inputs:
mavenPomFile: $(pomFile)
goals: 'javadoc:jar source:jar package'
options: '--batch-mode -Dmaven.test.skip=true -Dinclude-template $(mvnFlags)' # We include template-module so we ensure it always builds in CI
mavenOptions: '-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
options: '$(DefaultOptions) $(ProfileFlag) -Dmaven.test.skip=true -Dinclude-template' # We include template-module so we ensure it always builds in CI
mavenOptions: '$(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: $(javaVer)
jdkVersionOption: $(JavaVersion)
jdkArchitectureOption: 'x64'
publishJUnitResults: false

- powershell: |
# use sources files as a marker to find POM files so we can copy them to the output. The sources.jar file is generally
# in a target folder next to the pom.xml file so $_.Directory.Parent should get us the folder that contains the POM.
mkdir (Join-Path $(Build.ArtifactStagingDirectory) $(artifactDir))
dir -r -i *-sources.jar | % { copy (Join-Path $_.Directory.Parent.FullName "pom.xml") (Join-Path $(Build.ArtifactStagingDirectory) $(artifactDir) $_.Name.Replace("-sources.jar",".pom")) }
dir -r -i *.jar | % { copy $_ (Join-Path $(Build.ArtifactStagingDirectory) $(artifactDir)) }
dir -r -i *-sources.jar | % { copy (Join-Path $_.Directory.Parent.FullName "pom.xml") (Join-Path $(Build.ArtifactStagingDirectory) $_.Name.Replace("-sources.jar",".pom")) }
dir -r -i *.jar | % { copy $_ $(Build.ArtifactStagingDirectory) }
displayName: 'Copy JAR and POM files to artifact staging'
- task: PublishBuildArtifacts@1
displayName: 'Publish'
inputs:
artifactName: '$(ArtifactName)'

- job: 'Analyze'

Expand All @@ -70,8 +75,8 @@ jobs:
displayName: 'Install reporting tools'
inputs:
mavenPomFile: $(pomFile)
options: '--batch-mode -Dinclude-non-shipping-modules -DskipTests -Dgpg.skip'
mavenOptions: '-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
options: '$(DefaultOptions) -Dinclude-non-shipping-modules -DskipTests -Dgpg.skip'
mavenOptions: '$(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
Expand All @@ -82,8 +87,8 @@ jobs:
displayName: 'Generate Maven project site, including JavaDocs, SpotBugs, and CheckStyle reports'
inputs:
mavenPomFile: $(pomFile)
options: '--batch-mode -DskipTests -Dgpg.skip'
mavenOptions: '-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
options: '$(DefaultOptions) -DskipTests -Dgpg.skip'
mavenOptions: '$(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
jdkArchitectureOption: 'x64'
Expand All @@ -106,48 +111,48 @@ jobs:
strategy:
matrix:
Linux - Java 8:
os.name: 'Linux'
os.vmImage: 'ubuntu-16.04'
javaVer: '1.8'
mvnFlags: ''
OSName: 'Linux'
OSVmImage: 'ubuntu-16.04'
JavaVersion: '1.8'
ProfileFlag: ''
macOS - Java 8:
os.name: 'macOS'
os.vmImage: 'macOS-10.13'
javaVer: '1.8'
mvnFlags: ''
OSName: 'macOS'
OSVmImage: 'macOS-10.13'
JavaVersion: '1.8'
ProfileFlag: ''
Windows - Java 8:
os.name: 'Windows'
os.vmImage: 'vs2017-win2016'
javaVer: '1.8'
mvnFlags: ''
OSName: 'Windows'
OSVmImage: 'vs2017-win2016'
JavaVersion: '1.8'
ProfileFlag: ''
Linux - Java LTS:
os.name: 'Linux'
os.vmImage: 'ubuntu-16.04'
javaVer: '1.11'
mvnFlags: '-Djava-lts'
OSName: 'Linux'
OSVmImage: 'ubuntu-16.04'
JavaVersion: '1.11'
ProfileFlag: '-Djava-lts'
macOS - Java LTS:
os.name: 'macOS'
os.vmImage: 'macOS-10.13'
javaVer: '1.11'
mvnFlags: '-Djava-lts'
OSName: 'macOS'
OSVmImage: 'macOS-10.13'
JavaVersion: '1.11'
ProfileFlag: '-Djava-lts'
Windows - Java LTS:
os.name: 'Windows'
os.vmImage: 'vs2017-win2016'
javaVer: '1.11'
mvnFlags: '-Djava-lts'
OSName: 'Windows'
OSVmImage: 'vs2017-win2016'
JavaVersion: '1.11'
ProfileFlag: '-Djava-lts'

pool:
vmImage: $(os.vmImage)
vmImage: $(OSVmImage)

steps:
- task: Maven@3
displayName: 'Start Jetty'
inputs:
mavenPomFile: $(pomFile)
options: '--batch-mode $(mvnFlags)'
mavenOptions: '-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
options: '$(DefaultOptions) $(ProfileFlag)'
mavenOptions: '$(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: $(javaVer)
jdkVersionOption: $(JavaVersion)
jdkArchitectureOption: 'x64'
publishJUnitResults: false
goals: 'jetty:run-forked'
Expand All @@ -156,11 +161,16 @@ jobs:
displayName: 'Run tests'
inputs:
mavenPomFile: $(pomFile)
options: '--batch-mode $(mvnFlags)'
mavenOptions: '-Xmx3072m -Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
options: '$(DefaultOptions) $(ProfileFlag)'
mavenOptions: '-Xmx3072m $(LoggingOptions)'
javaHomeOption: 'JDKVersion'
jdkVersionOption: $(javaVer)
jdkVersionOption: $(JavaVersion)
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/TEST-*.xml'
publishJUnitResults: false
goals: 'test'

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
mergeTestResults: true
testRunTitle: '$(OSName) on Java $(JavaVersion)'
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ static CloudPool createIfNotExistPaaSPool(String poolId) throws Exception {
String POOL_OS_FAMILY = "4";
String POOL_OS_VERSION = "*";

// 5 minutes
long POOL_STEADY_TIMEOUT_IN_SECONDS = 5 * 60 * 1000;
// 10 minutes
long POOL_STEADY_TIMEOUT_IN_SECONDS = 10 * 60 * 1000;

// Check if pool exists
if (!batchClient.poolOperations().existsPool(poolId)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public void canCRUDLowPriIaaSPool() throws Exception {
int POOL_VM_COUNT = 0;
int POOL_LOW_PRI_VM_COUNT = 2;

// 5 minutes
long POOL_STEADY_TIMEOUT_IN_SECONDS = 5 * 60 * 1000;
// 10 minutes
long POOL_STEADY_TIMEOUT_IN_SECONDS = 10 * 60 * 1000;

// Check if pool exists
if (!batchClient.poolOperations().existsPool(poolId)) {
Expand Down Expand Up @@ -366,8 +366,8 @@ public void canCRUDLowPriPaaSPool() throws Exception {
String POOL_OS_FAMILY = "4";
String POOL_OS_VERSION = "*";

// 5 minutes
long POOL_STEADY_TIMEOUT_IN_SECONDS = 5 * 60 * 1000;
// 10 minutes
long POOL_STEADY_TIMEOUT_IN_SECONDS = 10 * 60 * 1000;

// Check if pool exists
if (!batchClient.poolOperations().existsPool(poolId)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@
<suppress checks="ConstantName" files="AlgorithmResolver.java"/>
<suppress checks="ConstantName" files="RsaKey.java"/>
<suppress checks="ConstantName" files="SymmetricKey.java"/>
<suppress checks="ConstantName" files="BatchErrorCodeStrings.java"/>
<suppress checks="ConstantName" files="TaskFailureInformationCodes.java"/>
</suppressions>
13 changes: 10 additions & 3 deletions eng/code-quality-reports/src/main/resources/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@
background-color: #fff;
border: 1px solid #e8e8e8;
font-size: 1.1em;
padding: 15px
padding: 15px;
overflow: hidden;
}

body.status-page .list-group .list-group-item a {
Expand Down Expand Up @@ -413,7 +414,6 @@
}

body.status-page footer {
position: absolute;
width: 100%;
bottom: 0;
height: 60px;
Expand Down Expand Up @@ -480,9 +480,11 @@ <h2>Azure Java SDK</h2>

<div class="group-items ">
<li class="list-group-item sub-component">
<ion-icon name="logo-github"></ion-icon>
<a href="https://github.com/Azure/azure-sdk-for-java/" target="_blank" class="links">GitHub</a>
</li>
<li class="list-group-item sub-component">
<ion-icon name="document"></ion-icon>
<a href="https://docs.microsoft.com/java/azure/" target="_blank" class="links">Azure Java Developers Documentation Home</a>
</li>
</div>
Expand All @@ -494,15 +496,19 @@ <h2>Azure Java SDK</h2>

<div class="group-items">
<li class="list-group-item sub-component">
<ion-icon name="book"></ion-icon>
<a href="staging/index.html" target="_blank" class="links">Maven Site</a>
</li>
<li class="list-group-item sub-component">
<ion-icon name="bug"></ion-icon>
<a href="staging/spotbugsXml.html" target="_blank" class="links">SpotBugs (Aggregate)</a>
</li>
<li class="list-group-item sub-component">
<ion-icon name="checkmark"></ion-icon>
<a href="staging/checkstyle-aggregate.html" target="_blank" class="links">CheckStyle (Aggregate)</a>
</li>
<li class="list-group-item sub-component">
<ion-icon name="copy"></ion-icon>
<a href="staging/apidocs/index.html" target="_blank" class="links">JavaDoc (Aggregate)</a>
</li>
</div>
Expand All @@ -514,6 +520,7 @@ <h2>Azure Java SDK</h2>

<div class="group-items">
<li class="list-group-item sub-component">
<ion-icon name="pulse"></ion-icon>
<a href="site/index.html" target="_blank" class="links">Azure Client SDK for Java</a>
<div class="pull-right">
<a href="https://dev.azure.com/azure-sdk/public/_build/latest?definitionId=17">
Expand All @@ -539,4 +546,4 @@ <h2>Azure Java SDK</h2>
</body>
<script src="https://unpkg.com/[email protected]/dist/ionicons.js"></script>

</html>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
<Bug pattern="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS"/>
</Match>

<!-- These AesKw methods are publicly released APIs with incorrect name casing. -->
<!-- Cryptographic algorithms are publicly released APIs with incorrect name casing. -->
<Match>
<Class name="~com\.microsoft\.azure\.keyvault\.cryptography\.algorithms\.AesKw(128|192|256)" />
<Or>
<Class name="~com\.microsoft\.azure\.keyvault\.cryptography\.algorithms\.(Aes|Rsa)(.+)" />
<Class name="~com\.microsoft\.azure\.keyvault\.cryptography\.(.+)Algorithm" />
</Or>
<Method name="~(CreateDecryptor|CreateEncryptor)" />
<Bug pattern="NM_METHOD_NAMING_CONVENTION"/>
</Match>
Expand Down Expand Up @@ -45,4 +48,17 @@
<Method name="~(extractChallenge|isValidChallenge|supportsMessageProtection)"/>
<Bug pattern="DM_CONVERT_CASE"/>
</Match>
<!-- HTTP header, "content-type" is not localised. -->
<Match>
<Class name="com.microsoft.azure.keyvault.messagesecurity.HttpMessageSecurity"/>
<Method name="unprotectResponse"/>
<Bug pattern="DM_CONVERT_CASE"/>
</Match>

<!-- Known issue in autorest where it will generate a variable with a value of null.
https://github.com/Azure/autorest.java/issues/324 -->
<Match>
<Class name="com.microsoft.azure.keyvault.KeyVaultClientImpl"/>
<Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE"/>
</Match>
</FindBugsFilter>
Loading

0 comments on commit aaa1d5e

Please sign in to comment.