From ebe9c6d4350c4f890f014b582d6da8b9b5fe98d1 Mon Sep 17 00:00:00 2001 From: Jianping Chen Date: Tue, 1 Jun 2021 10:15:34 -0700 Subject: [PATCH] [Communication]: Remove unused code in pom and test files (#21654) * Remove unused code in pom and test files * Restore unintended change * Revert a test file change * Restore tests.yml * Remove unused env variable in tests.yml * Remove tests.yml * Keep skipping SMS tests in INT * Try to skip jacoco in INT * try different syntax * Try use string as much as we can * Try escape quotes * Try use a variable inside loop * Fix a typo * Move variable to a different place * Try Macro syntax * Remove variable, use stage name instead * Fix syntax * Try a different syntax * Try something simple * Move variables to the right place * Flip logic * Renamve variable * Give up on customizing jacoco.skip * Try to use variable to skp jacoco * Try different syntax * Move variable declaration * Try to set variable * Try PreSteps * Remove local variable * Remove unnecessary overwrite * Remove quotes Co-authored-by: JP Chen --- .../azure-communication-chat/pom.xml | 42 ----------- .../chat/ChatAsyncClientTest.java | 7 -- .../communication/chat/ChatClientTest.java | 7 -- .../chat/ChatClientTestBase.java | 7 -- .../chat/ChatThreadAsyncClientTest.java | 7 -- .../chat/ChatThreadClientTest.java | 7 -- .../azure-communication-identity/pom.xml | 42 ----------- .../CommunicationIdentityAsyncTests.java | 7 -- .../CommunicationIdentityClientTestBase.java | 7 -- .../identity/CommunicationIdentityTests.java | 7 -- .../azure-communication-phonenumbers/pom.xml | 56 --------------- ...honeNumbersAsyncClientIntegrationTest.java | 7 -- .../PhoneNumbersClientBuilderTest.java | 2 - .../PhoneNumbersClientIntegrationTest.java | 7 -- .../PhoneNumbersIntegrationTestBase.java | 6 -- .../azure-communication-sms/pom.xml | 58 --------------- .../azure/communication/sms/SmsTestBase.java | 5 +- .../communication-tests-template.yml | 5 +- sdk/communication/tests.yml | 71 ------------------- 19 files changed, 5 insertions(+), 352 deletions(-) delete mode 100644 sdk/communication/tests.yml diff --git a/sdk/communication/azure-communication-chat/pom.xml b/sdk/communication/azure-communication-chat/pom.xml index 7cc62dd52847b..f0a85bb294e3a 100644 --- a/sdk/communication/azure-communication-chat/pom.xml +++ b/sdk/communication/azure-communication-chat/pom.xml @@ -170,47 +170,5 @@ - - disable-coverage-if-identity - - - env.TEST_PACKAGES_ENABLED - identity - - - - src/main - src/test - true - - - - disable-coverage-if-phonenumbers - - - env.TEST_PACKAGES_ENABLED - phonenumbers - - - - src/main - src/test - true - - - - disable-coverage-if-sms - - - env.TEST_PACKAGES_ENABLED - sms - - - - src/main - src/test - true - - diff --git a/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatAsyncClientTest.java b/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatAsyncClientTest.java index 27e723e581703..eebeaf5b9f31a 100644 --- a/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatAsyncClientTest.java +++ b/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatAsyncClientTest.java @@ -30,7 +30,6 @@ import java.util.UUID; import static org.junit.jupiter.api.Assertions.*; -import static org.junit.jupiter.api.Assumptions.assumeTrue; /** * Set the AZURE_TEST_MODE environment variable to either PLAYBACK or RECORD to determine if tests are playback or @@ -46,12 +45,6 @@ public class ChatAsyncClientTest extends ChatClientTestBase { private CommunicationUserIdentifier firstThreadMember; private CommunicationUserIdentifier secondThreadMember; - @Override - protected void beforeTest() { - super.beforeTest(); - assumeTrue(shouldEnableChatTests()); - } - @Override protected void afterTest() { super.afterTest(); diff --git a/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatClientTest.java b/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatClientTest.java index 2c803d0e9a487..89cd18a49ba8a 100644 --- a/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatClientTest.java +++ b/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatClientTest.java @@ -6,7 +6,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assumptions.assumeTrue; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -40,12 +39,6 @@ public class ChatClientTest extends ChatClientTestBase { private CommunicationUserIdentifier firstThreadMember; private CommunicationUserIdentifier secondThreadMember; - @Override - protected void beforeTest() { - super.beforeTest(); - assumeTrue(shouldEnableChatTests()); - } - @Override protected void afterTest() { super.afterTest(); diff --git a/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatClientTestBase.java b/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatClientTestBase.java index 048e7420a984e..1df05fdd4ca80 100644 --- a/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatClientTestBase.java +++ b/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatClientTestBase.java @@ -46,9 +46,6 @@ public class ChatClientTestBase extends TestBase { protected static final String ACCESS_KEY = Configuration.getGlobalConfiguration() .get("COMMUNICATION_SERVICE_ACCESS_KEY", "pw=="); - private static final String TEST_PACKAGES_ENABLED = Configuration.getGlobalConfiguration() - .get("TEST_PACKAGES_ENABLED", "all"); - private static final StringJoiner JSON_PROPERTIES_TO_REDACT = new StringJoiner("\":\"|\"", "\"", "\":\"") .add("token"); @@ -215,10 +212,6 @@ protected ChatClientBuilder addLoggingPolicyForIdentityClientBuilder(ChatClientB return builder.addPolicy(new CommunicationLoggerPolicy(testName)); } - protected boolean shouldEnableChatTests() { - return TEST_PACKAGES_ENABLED.matches("(all|chat)"); - } - private String redact(String content, Matcher matcher, String replacement) { while (matcher.find()) { String captureGroup = matcher.group(1); diff --git a/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatThreadAsyncClientTest.java b/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatThreadAsyncClientTest.java index 064e3897c8dff..e57f75afd1ac6 100644 --- a/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatThreadAsyncClientTest.java +++ b/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatThreadAsyncClientTest.java @@ -6,7 +6,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assumptions.assumeTrue; import com.azure.communication.chat.implementation.models.CommunicationErrorResponseException; import com.azure.core.exception.HttpResponseException; @@ -58,12 +57,6 @@ public class ChatThreadAsyncClientTest extends ChatClientTestBase { private CommunicationUserIdentifier firstAddedParticipant; private CommunicationUserIdentifier secondAddedParticipant; - @Override - protected void beforeTest() { - super.beforeTest(); - assumeTrue(shouldEnableChatTests()); - } - @Override protected void afterTest() { super.afterTest(); diff --git a/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatThreadClientTest.java b/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatThreadClientTest.java index 8a55178ab83fa..448dfcbb28de1 100644 --- a/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatThreadClientTest.java +++ b/sdk/communication/azure-communication-chat/src/test/java/com/azure/communication/chat/ChatThreadClientTest.java @@ -6,7 +6,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assumptions.assumeTrue; import static org.junit.jupiter.api.Assertions.assertThrows; import com.azure.core.exception.HttpResponseException; @@ -54,12 +53,6 @@ public class ChatThreadClientTest extends ChatClientTestBase { private CommunicationUserIdentifier firstAddedParticipant; private CommunicationUserIdentifier secondAddedParticipant; - @Override - protected void beforeTest() { - super.beforeTest(); - assumeTrue(shouldEnableChatTests()); - } - @Override protected void afterTest() { super.afterTest(); diff --git a/sdk/communication/azure-communication-identity/pom.xml b/sdk/communication/azure-communication-identity/pom.xml index 03b1a27204bba..b699d5458ba61 100644 --- a/sdk/communication/azure-communication-identity/pom.xml +++ b/sdk/communication/azure-communication-identity/pom.xml @@ -181,47 +181,5 @@ - - disable-coverage-if-phonenumbers - - - env.TEST_PACKAGES_ENABLED - phonenumbers - - - - src/main - src/test - true - - - - disable-coverage-if-sms - - - env.TEST_PACKAGES_ENABLED - sms - - - - src/main - src/test - true - - - - disable-coverage-if-chat - - - env.TEST_PACKAGES_ENABLED - chat - - - - src/main - src/test - true - - diff --git a/sdk/communication/azure-communication-identity/src/test/java/com/azure/communication/identity/CommunicationIdentityAsyncTests.java b/sdk/communication/azure-communication-identity/src/test/java/com/azure/communication/identity/CommunicationIdentityAsyncTests.java index 750dbf95f6fa3..f97a0cd92d7e4 100644 --- a/sdk/communication/azure-communication-identity/src/test/java/com/azure/communication/identity/CommunicationIdentityAsyncTests.java +++ b/sdk/communication/azure-communication-identity/src/test/java/com/azure/communication/identity/CommunicationIdentityAsyncTests.java @@ -5,7 +5,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assumptions.assumeTrue; import java.util.Arrays; import java.util.List; @@ -26,12 +25,6 @@ public class CommunicationIdentityAsyncTests extends CommunicationIdentityClientTestBase { private CommunicationIdentityAsyncClient asyncClient; - @Override - protected void beforeTest() { - super.beforeTest(); - assumeTrue(shouldEnableIdentityTests()); - } - @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") public void createAsyncIdentityClientUsingManagedIdentity(HttpClient httpClient) { diff --git a/sdk/communication/azure-communication-identity/src/test/java/com/azure/communication/identity/CommunicationIdentityClientTestBase.java b/sdk/communication/azure-communication-identity/src/test/java/com/azure/communication/identity/CommunicationIdentityClientTestBase.java index 697c2c9d4160d..30a12efc9a6d9 100644 --- a/sdk/communication/azure-communication-identity/src/test/java/com/azure/communication/identity/CommunicationIdentityClientTestBase.java +++ b/sdk/communication/azure-communication-identity/src/test/java/com/azure/communication/identity/CommunicationIdentityClientTestBase.java @@ -34,9 +34,6 @@ public class CommunicationIdentityClientTestBase extends TestBase { protected static final String CONNECTION_STRING = Configuration.getGlobalConfiguration() .get("COMMUNICATION_LIVETEST_DYNAMIC_CONNECTION_STRING", "endpoint=https://REDACTED.communication.azure.com/;accesskey=QWNjZXNzS2V5"); - private static final String TEST_PACKAGES_ENABLED = Configuration.getGlobalConfiguration() - .get("TEST_PACKAGES_ENABLED", "all"); - private static final StringJoiner JSON_PROPERTIES_TO_REDACT = new StringJoiner("\":\"|\"", "\"", "\":\"") .add("token"); @@ -138,10 +135,6 @@ private Mono logHeaders(String testName, HttpPipelineNextPolicy ne }); } - protected boolean shouldEnableIdentityTests() { - return TEST_PACKAGES_ENABLED.matches("(all|identity)"); - } - static class FakeCredentials implements TokenCredential { @Override public Mono getToken(TokenRequestContext tokenRequestContext) { diff --git a/sdk/communication/azure-communication-identity/src/test/java/com/azure/communication/identity/CommunicationIdentityTests.java b/sdk/communication/azure-communication-identity/src/test/java/com/azure/communication/identity/CommunicationIdentityTests.java index 6e0b225c83a1b..b0ac974b2ba85 100644 --- a/sdk/communication/azure-communication-identity/src/test/java/com/azure/communication/identity/CommunicationIdentityTests.java +++ b/sdk/communication/azure-communication-identity/src/test/java/com/azure/communication/identity/CommunicationIdentityTests.java @@ -5,7 +5,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assumptions.assumeTrue; import java.util.Arrays; import java.util.List; @@ -24,12 +23,6 @@ public class CommunicationIdentityTests extends CommunicationIdentityClientTestBase { private CommunicationIdentityClient client; - @Override - protected void beforeTest() { - super.beforeTest(); - assumeTrue(shouldEnableIdentityTests()); - } - @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") public void createIdentityClientUsingManagedIdentity(HttpClient httpClient) { diff --git a/sdk/communication/azure-communication-phonenumbers/pom.xml b/sdk/communication/azure-communication-phonenumbers/pom.xml index 72d1b01929f46..414f997d37fd7 100644 --- a/sdk/communication/azure-communication-phonenumbers/pom.xml +++ b/sdk/communication/azure-communication-phonenumbers/pom.xml @@ -180,61 +180,5 @@ - - disable-coverage-if-identity - - - env.TEST_PACKAGES_ENABLED - identity - - - - src/main - src/test - true - - - - disable-coverage-if-sms - - - env.TEST_PACKAGES_ENABLED - sms - - - - src/main - src/test - true - - - - disable-coverage-if-chat - - - env.TEST_PACKAGES_ENABLED - chat - - - - src/main - src/test - true - - - - disable-coverage-if-phonenumbers - - - env.COMMUNICATION_SKIP_INT_PHONENUMBERS_TEST - true - - - - src/main - src/test - true - - diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersAsyncClientIntegrationTest.java b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersAsyncClientIntegrationTest.java index 245222009f7f2..22e2c3b6787cb 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersAsyncClientIntegrationTest.java +++ b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersAsyncClientIntegrationTest.java @@ -26,16 +26,9 @@ import java.time.Duration; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assumptions.assumeTrue; public class PhoneNumbersAsyncClientIntegrationTest extends PhoneNumbersIntegrationTestBase { - @Override - protected void beforeTest() { - super.beforeTest(); - assumeTrue(shouldEnablePhoneNumbersTests()); - } - @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") public void getPurchasedPhoneNumber(HttpClient httpClient) { diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersClientBuilderTest.java b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersClientBuilderTest.java index 7fab07c5f7cdf..66ddc4898cf45 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersClientBuilderTest.java +++ b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersClientBuilderTest.java @@ -26,7 +26,6 @@ import static org.junit.jupiter.api.Assertions.*; -import static org.junit.jupiter.api.Assumptions.assumeTrue; import static org.mockito.Mockito.*; @Execution(value = ExecutionMode.SAME_THREAD) @@ -45,7 +44,6 @@ public class PhoneNumbersClientBuilderTest { void setUp() { this.httpClient = mock(HttpClient.class); this.clientBuilder = Mockito.spy(new PhoneNumbersClientBuilder()); - assumeTrue(Configuration.getGlobalConfiguration().get("TEST_PACKAGES_ENABLED", "all").matches("all|phonenumbers")); } @AfterEach diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersClientIntegrationTest.java b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersClientIntegrationTest.java index 2ddc060f213bd..0b2b0090c7a4b 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersClientIntegrationTest.java +++ b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersClientIntegrationTest.java @@ -30,16 +30,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.fail; -import static org.junit.jupiter.api.Assumptions.assumeTrue; public class PhoneNumbersClientIntegrationTest extends PhoneNumbersIntegrationTestBase { - @Override - protected void beforeTest() { - super.beforeTest(); - assumeTrue(shouldEnablePhoneNumbersTests()); - } - @ParameterizedTest @MethodSource("com.azure.core.test.TestBase#getHttpClients") public void getPurchasedPhoneNumber(HttpClient httpClient) { diff --git a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersIntegrationTestBase.java b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersIntegrationTestBase.java index 12f68bb147892..03bed7ebe66cb 100644 --- a/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersIntegrationTestBase.java +++ b/sdk/communication/azure-communication-phonenumbers/src/test/java/com/azure/communication/phonenumbers/PhoneNumbersIntegrationTestBase.java @@ -37,9 +37,6 @@ public class PhoneNumbersIntegrationTestBase extends TestBase { protected static final String PHONE_NUMBER = Configuration.getGlobalConfiguration().get("AZURE_PHONE_NUMBER", "+11234567891"); - private static final String TEST_PACKAGES_ENABLED = Configuration.getGlobalConfiguration() - .get("TEST_PACKAGES_ENABLED", "all"); - private static final StringJoiner JSON_PROPERTIES_TO_REDACT = new StringJoiner("\":\"|\"", "\"", "\":\"") .add("id") @@ -146,7 +143,4 @@ private String redact(String content, Matcher matcher, String replacement) { return content; } - protected boolean shouldEnablePhoneNumbersTests() { - return TEST_PACKAGES_ENABLED.matches("(all|phonenumbers)"); - } } diff --git a/sdk/communication/azure-communication-sms/pom.xml b/sdk/communication/azure-communication-sms/pom.xml index 2cf833da7b9a6..9ac2c2216164e 100644 --- a/sdk/communication/azure-communication-sms/pom.xml +++ b/sdk/communication/azure-communication-sms/pom.xml @@ -144,62 +144,4 @@ - - - disable-coverage-if-identity - - - env.TEST_PACKAGES_ENABLED - identity - - - - src/main - src/test - true - - - - disable-coverage-if-phonenumbers - - - env.TEST_PACKAGES_ENABLED - phonenumbers - - - - src/main - src/test - true - - - - disable-coverage-if-chat - - - env.TEST_PACKAGES_ENABLED - chat - - - - src/main - src/test - true - - - - disable-coverage-if-sms - - - env.COMMUNICATION_SKIP_INT_PHONENUMBERS_TEST - true - - - - src/main - src/test - true - - - diff --git a/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsTestBase.java b/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsTestBase.java index f21bd701cc4f5..81547473b298d 100644 --- a/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsTestBase.java +++ b/sdk/communication/azure-communication-sms/src/test/java/com/azure/communication/sms/SmsTestBase.java @@ -38,9 +38,6 @@ public class SmsTestBase extends TestBase { protected static final String FROM_PHONE_NUMBER = Configuration.getGlobalConfiguration() .get("AZURE_PHONE_NUMBER", "+15551234567"); - private static final String TEST_PACKAGES_ENABLED = Configuration.getGlobalConfiguration() - .get("TEST_PACKAGES_ENABLED", "all"); - private static final String SKIP_INT_SMS_TEST = Configuration.getGlobalConfiguration() .get("COMMUNICATION_SKIP_INT_SMS_TEST", "False"); @@ -153,6 +150,6 @@ private String redact(String content, Matcher matcher, String replacement) { } protected boolean shouldEnableSmsTests() { - return TEST_PACKAGES_ENABLED.matches("(all|sms)") && !Boolean.parseBoolean(SKIP_INT_SMS_TEST); + return !Boolean.parseBoolean(SKIP_INT_SMS_TEST); } } diff --git a/sdk/communication/communication-tests-template.yml b/sdk/communication/communication-tests-template.yml index 3d567ca197a22..627005f89d7e4 100644 --- a/sdk/communication/communication-tests-template.yml +++ b/sdk/communication/communication-tests-template.yml @@ -21,6 +21,9 @@ stages: groupId: com.azure safeName: ${{ parameters.SafeName }} ServiceDirectory: communication + PreSteps: + - bash: echo "##vso[task.setvariable variable=DefaultTestOptions]-Djacoco.skip=true $(DefaultTestOptions)" + condition: not(startsWith(variables['System.StageName'], 'Public')) PostSteps: - task: PublishCodeCoverageResults@1 condition: and(eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['JavaTestVersion'], '1.11'), startsWith(variables['System.StageName'], 'Public')) @@ -30,4 +33,4 @@ stages: reportDirectory: sdk/communication/${{ parameters.PackageName }}/target/site/jacoco/ failIfCoverageEmpty: true EnvVars: - SKIP_LIVE_TEST: TRUE + SKIP_LIVE_TEST: TRUE \ No newline at end of file diff --git a/sdk/communication/tests.yml b/sdk/communication/tests.yml deleted file mode 100644 index 13b976f89e37b..0000000000000 --- a/sdk/communication/tests.yml +++ /dev/null @@ -1,71 +0,0 @@ -trigger: none - -parameters: - - name: TestPackagesEnabled - displayName: Tests Enabled - type: string - default: all - values: - - all - - chat - - identity - - phonenumbers - - sms - -stages: -- template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml - parameters: - CloudConfig: - Public: - SubscriptionConfigurations: - - $(sub-config-azure-cloud-test-resources) - - $(sub-config-communication-services-cloud-test-resources-common) - - $(sub-config-communication-services-cloud-test-resources-java) - Int: - SubscriptionConfigurations: - - $(sub-config-communication-int-test-resources-common) - - $(sub-config-communication-int-test-resources-java) - Clouds: Public,Int - Artifacts: - - name: azure-communication-chat - groupId: com.azure - safeName: azurecommunicationchat - - name: azure-communication-sms - groupId: com.azure - safeName: azurecommunicationsms - - name: azure-communication-identity - groupId: com.azure - safeName: azurecommunicationidentity - - name: azure-communication-phonenumbers - groupId: com.azure - safeName: azurecommunicationphonenumbers - ServiceDirectory: communication - PostSteps: - - task: Maven@3 - displayName: 'Generate aggregate code coverage report' - # The OSName variable gets set by the verify-agent-os.yml template - condition: and(eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['JavaTestVersion'], '1.11')) - inputs: - mavenPomFile: sdk/communication/pom.xml - options: -Pcoverage - mavenOptions: '$(MemoryOptions) $(LoggingOptions)' - javaHomeOption: 'JDKVersion' - jdkVersionOption: $(JavaTestVersion) - jdkArchitectureOption: 'x64' - goals: jacoco:report-aggregate - # we want to run this when TestFromSource isn't true - condition: and(succeeded(), ne(variables['TestFromSource'],'true')) - - # Azure DevOps only seems to respect the last code coverage result published, so only do this for Windows + Java LTS. - # Code coverage reporting is setup only for Track 2 modules. - - task: PublishCodeCoverageResults@1 - condition: and(eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['JavaTestVersion'], '1.11')) - inputs: - codeCoverageTool: JaCoCo - summaryFileLocation: sdk/communication/target/site/jacoco-aggregate/jacoco.xml - reportDirectory: sdk/communication/target/site/jacoco-aggregate/ - failIfCoverageEmpty: false - EnvVars: - SKIP_PHONENUMBER_INTEGRATION_TESTS: TRUE - SKIP_LIVE_TEST: TRUE - TEST_PACKAGES_ENABLED: ${{ parameters.TestPackagesEnabled }}