Skip to content

Comments

Live tests#2812

Merged
weshaggard merged 19 commits intoAzure:masterfrom
g2vinay:liveTests
Jan 17, 2019
Merged

Live tests#2812
weshaggard merged 19 commits intoAzure:masterfrom
g2vinay:liveTests

Conversation

@g2vinay
Copy link
Member

@g2vinay g2vinay commented Dec 20, 2018

Contains changes for Azure Key Vault Live Tests.

@g2vinay g2vinay requested review from lenala and weshaggard December 20, 2018 23:11
@azuresdkci
Copy link
Contributor

Can one of the admins verify this patch?


private static String getLiveVaultUri1() {
return getenvOrDefault("keyvault.vaulturi", "https://javasdktestvault.vault.azure.net");
return getenvOrDefault("KEYVAULT_VAULTURI", "https://javasdktestvault.vault.azure.net");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity - what motivated the changing of all key names to uppercase with underscores rather that periods?

Copy link
Contributor

@lenala lenala Jan 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like periods are not processed correctly on linux system, and VSTS converts them to underscore, and converts environment variable names to uppercase anyway. Please see https://developercommunity.visualstudio.com/content/problem/328064/vsts-silently-converts-variable-names-to-uppercase.html for uppercase and https://stackoverflow.com/questions/50020314/escaping-environment-variable-names-in-vsts for underscores.

byte[] EK = { (byte) 0x96, 0x77, (byte) 0x8B, 0x25, (byte) 0xAE, 0x6C, (byte) 0xA4, 0x35, (byte) 0xF9, 0x2B, 0x5B, (byte) 0x97, (byte) 0xC0, 0x50, (byte) 0xAE, (byte) 0xD2, 0x46, (byte) 0x8A, (byte) 0xB8, (byte) 0xA1, 0x7A, (byte) 0xD8, 0x4E, 0x5D };

String TEST_SECRET_NAME = SECRET_NAME + "1";
String TEST_SECRET_NAME = SECRET_NAME + "4";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It always makes me a little nervous when I see magic numbers being changed in unit tests. Why is this required?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests involve creating and deleting secrets.

Multiple Tests using same magic number for the secret name conflicts when a test is trying to create a secret and the previous Test requested a deletion. And the deletion is still in queue.
To avoid this conflict, changed the magic number for the test.

* Sample method.
* @return message
*/
public final String getMessage() {
return "hello";
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This, and the package-info.java below, are unrelated changes, aren't they?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They both caused checkstyle and because of that the build fail.

@@ -2,32 +2,20 @@ trigger:
- master

jobs:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you have some merge conflicts to handle which should get this file updated to what is currently committed in the repo. As it stands you are reverting some changes that were committed because your branch is behind master.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conflicts resolved

mvn test -Dsurefire.rerunFailingTestsCount=3 $LOG_PARAMS -Dparallel=classes -DthreadCount=3 -DforkCount=1C -f pom.client.build.xml
displayName: 'Bash Script'
env:
ARM_CLIENTID: $(ARM_CLIENTID)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these 2 env variables the only difference between live vs not live?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are more Variables defined in the variables tab of dev ops pipeline.

headshot786 and others added 3 commits January 9, 2019 17:22
# Conflicts:
#	.azure-pipelines/client.test.yml
#	.azure-pipelines/client.yml
#	keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/AsyncOperationsTest.java
#	keyvault/data-plane/azure-keyvault/src/test/java/com/microsoft/azure/keyvault/test/SecretOperationsTest.java
#	keyvault/data-plane/pom.xml
- name: ARM_CLIENTKEY
value: $(java-keyvault-test-arm-client-key)

resources:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need "resources: self"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed actually,
removed.

- bash: |
LOG_PARAMS='-Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn'
mvn test -Dhttp.keepAlive=false -Dsurefire.rerunFailingTestsCount=3 $LOG_PARAMS -f pom.client.build.xml
displayName: 'Bash Script'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update this to represent what it is doing, like "Running Live Tests"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated it.

queue:
name: Hosted VS2017
steps:
- bash: |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you aren't using the Maven@3 task to run the tests similar to https://github.com/Azure/azure-sdk-for-java/blob/master/.azure-pipelines/client.test.yml#L17?

In general we should try to do that to help be consistent and also that allows us to capture the test results into the test tab of the build which gives us a good view of the tests than ran and a history of them.

Copy link
Member Author

@g2vinay g2vinay Jan 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The environment variables were not read during the build when tried to configure as Maven task.

<name>KEYVAULT_VAULTURI</name>
<value>https://tifchen-keyvault-fancy.vault.azure.net</value>
<name>KEYVAULT_VAULTURI</name>
<value>https://azure-keyvault-3.vault.azure.net</value>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you are setting these in 3 places. One is here, one is below and one in the build definition. Do they need to be set in all these places?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, the values should only be in environment variables section of pom.
Removed from other places.

Copy link
Member

@weshaggard weshaggard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build pipeline looks good but please get @schaabs or @lenala to sign-off on the test changes.

Copy link
Contributor

@lenala lenala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@@ -325,8 +312,8 @@
</includes>
<environmentVariables>
<test.mode>${testMode}</test.mode>
<KEYVAULT_VAULTURI>https://tifchen-keyvault-fancy.vault.azure.net</KEYVAULT_VAULTURI>
<KEYVAULT_VAULTURI_ALT>https://tifchen-keyvault-fancier.vault.azure.net</KEYVAULT_VAULTURI_ALT>
<KEYVAULT_VAULTURI>https://azure-keyvault-3.vault.azure.net</KEYVAULT_VAULTURI>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about here? Should we also remove these?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you removed them from the YAML instead so there is no duplication.

@weshaggard weshaggard merged commit 02f0c7e into Azure:master Jan 17, 2019
@JonathanGiles JonathanGiles added the Client This issue points to a problem in the data-plane of the library. label Feb 13, 2019
@g2vinay g2vinay deleted the liveTests branch July 13, 2023 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Client This issue points to a problem in the data-plane of the library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants