You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by mm...@apache.org on 2021/11/19 10:36:12 UTC
[ignite-extensions] branch master updated: IGNITE-15869 Add tests configuration properties for aws, gce, azure (#84)
This is an automated email from the ASF dual-hosted git repository.
mmuzaf pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-extensions.git
The following commit(s) were added to refs/heads/master by this push:
new e34396d IGNITE-15869 Add tests configuration properties for aws, gce, azure (#84)
e34396d is described below
commit e34396d62b2829448e05bb3eca6ce7b9e485d45c
Author: Maxim Muzafarov <mm...@apache.org>
AuthorDate: Fri Nov 19 13:35:41 2021 +0300
IGNITE-15869 Add tests configuration properties for aws, gce, azure (#84)
---
modules/aws-ext/README.txt | 9 ++++
.../modules/core/src/test/config/log4j-test.xml | 57 ++++++++++++++++++++++
.../modules/core/src/test/config/tests.properties | 16 ++++++
.../ignite/testsuites/IgniteS3TestSuite.java | 5 +-
modules/azure-ext/README.txt | 10 ++++
.../modules/core/src/test/config/log4j-test.xml | 57 ++++++++++++++++++++++
.../modules/core/src/test/config/tests.properties | 16 ++++++
.../azure/TcpDiscoveryAzureBlobStoreIpFinder.java | 30 ++++--------
.../ignite/testsuites/IgniteAzureTestSuite.java | 7 +--
modules/gce-ext/README.txt | 9 ++++
.../modules/core/src/test/config/log4j-test.xml | 57 ++++++++++++++++++++++
.../modules/core/src/test/config/tests.properties | 16 ++++++
.../ignite/testsuites/IgniteGCETestSuite.java | 7 +--
parent/pom.xml | 2 +-
14 files changed, 269 insertions(+), 29 deletions(-)
diff --git a/modules/aws-ext/README.txt b/modules/aws-ext/README.txt
index c3b03ef..110399a 100644
--- a/modules/aws-ext/README.txt
+++ b/modules/aws-ext/README.txt
@@ -9,6 +9,15 @@ Depending on how you use Ignite, you can an extension using one of the following
- Add libraries from lib/optional/{module-dir} to the classpath of your application.
- Add a module as a Maven dependency to your project.
+
+Building Module And Running Tests
+---------------------------------
+
+To build and run AWS extension use the command below with the right credentials to the AWS service:
+
+mvn clean package -pl modules/aws-ext -Dtest.amazon.access.key=<key> -Dtest.amazon.secret.key=<key>
+
+
Importing AWS Module In Maven Project
-------------------------------------
diff --git a/modules/aws-ext/modules/core/src/test/config/log4j-test.xml b/modules/aws-ext/modules/core/src/test/config/log4j-test.xml
new file mode 100644
index 0000000..cc2146e
--- /dev/null
+++ b/modules/aws-ext/modules/core/src/test/config/log4j-test.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN"
+ "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="DEBUG"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="[%d{ISO8601}][%-5p][%t][%c{1}] %m%n"/>
+ </layout>
+
+ <filter class="org.apache.log4j.varia.LevelRangeFilter">
+ <param name="levelMin" value="DEBUG"/>
+ <param name="levelMax" value="INFO"/>
+ </filter>
+ </appender>
+
+ <appender name="CONSOLE_ERR" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.err"/>
+
+ <param name="Threshold" value="WARN"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="[%d{ISO8601}][%-5p][%t][%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <category name="org">
+ <level value="INFO"/>
+ </category>
+
+ <root>
+ <level value="INFO"/>
+
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="CONSOLE_ERR"/>
+ </root>
+</log4j:configuration>
diff --git a/modules/aws-ext/modules/core/src/test/config/tests.properties b/modules/aws-ext/modules/core/src/test/config/tests.properties
new file mode 100644
index 0000000..86094c8
--- /dev/null
+++ b/modules/aws-ext/modules/core/src/test/config/tests.properties
@@ -0,0 +1,16 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
diff --git a/modules/aws-ext/src/test/java/org/apache/ignite/testsuites/IgniteS3TestSuite.java b/modules/aws-ext/src/test/java/org/apache/ignite/testsuites/IgniteS3TestSuite.java
index 0b3a404..0096926 100644
--- a/modules/aws-ext/src/test/java/org/apache/ignite/testsuites/IgniteS3TestSuite.java
+++ b/modules/aws-ext/src/test/java/org/apache/ignite/testsuites/IgniteS3TestSuite.java
@@ -17,6 +17,7 @@
package org.apache.ignite.testsuites;
+import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.spi.checkpoint.s3.S3CheckpointManagerSelfTest;
import org.apache.ignite.spi.checkpoint.s3.S3CheckpointSpiConfigSelfTest;
import org.apache.ignite.spi.checkpoint.s3.S3CheckpointSpiSelfTest;
@@ -89,7 +90,7 @@ public class IgniteS3TestSuite {
* @return Bucket name.
*/
public static String getBucketName(final String dfltBucketName) {
- String val = System.getenv("test.s3.bucket.name");
+ String val = X.getSystemOrEnv("test.s3.bucket.name");
return val == null ? dfltBucketName : val;
}
@@ -99,7 +100,7 @@ public class IgniteS3TestSuite {
* @return Environment variable value.
*/
private static String getRequiredEnvVar(String name) {
- String key = System.getenv(name);
+ String key = X.getSystemOrEnv(name);
assert key != null : String.format("Environment variable '%s' is not set", name);
diff --git a/modules/azure-ext/README.txt b/modules/azure-ext/README.txt
index a0ff6f5..b33f4b9 100644
--- a/modules/azure-ext/README.txt
+++ b/modules/azure-ext/README.txt
@@ -9,6 +9,16 @@ Depending on how you use Ignite, you can an extension using one of the following
- Add libraries from lib/optional/{module-dir} to the classpath of your application.
- Add a module as a Maven dependency to your project.
+
+Building Azure Module And Running Tests
+---------------------------------------
+
+To build and run Azure extension use the command below with the right credentials to the Azure service:
+
+mvn clean package -pl modules/azure-ext -Dtest.azure.account.name=uname -Dtest.azure.account.key=key
+-Dtest.azure.endpoint=http://127.0.0.1:10000/devstoreaccount
+
+
Importing Azure Module In Maven Project
-------------------------------------
diff --git a/modules/azure-ext/modules/core/src/test/config/log4j-test.xml b/modules/azure-ext/modules/core/src/test/config/log4j-test.xml
new file mode 100644
index 0000000..cc2146e
--- /dev/null
+++ b/modules/azure-ext/modules/core/src/test/config/log4j-test.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN"
+ "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="DEBUG"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="[%d{ISO8601}][%-5p][%t][%c{1}] %m%n"/>
+ </layout>
+
+ <filter class="org.apache.log4j.varia.LevelRangeFilter">
+ <param name="levelMin" value="DEBUG"/>
+ <param name="levelMax" value="INFO"/>
+ </filter>
+ </appender>
+
+ <appender name="CONSOLE_ERR" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.err"/>
+
+ <param name="Threshold" value="WARN"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="[%d{ISO8601}][%-5p][%t][%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <category name="org">
+ <level value="INFO"/>
+ </category>
+
+ <root>
+ <level value="INFO"/>
+
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="CONSOLE_ERR"/>
+ </root>
+</log4j:configuration>
diff --git a/modules/azure-ext/modules/core/src/test/config/tests.properties b/modules/azure-ext/modules/core/src/test/config/tests.properties
new file mode 100644
index 0000000..86094c8
--- /dev/null
+++ b/modules/azure-ext/modules/core/src/test/config/tests.properties
@@ -0,0 +1,16 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
diff --git a/modules/azure-ext/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/azure/TcpDiscoveryAzureBlobStoreIpFinder.java b/modules/azure-ext/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/azure/TcpDiscoveryAzureBlobStoreIpFinder.java
index 6540909..322148f 100644
--- a/modules/azure-ext/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/azure/TcpDiscoveryAzureBlobStoreIpFinder.java
+++ b/modules/azure-ext/src/main/java/org/apache/ignite/spi/discovery/tcp/ipfinder/azure/TcpDiscoveryAzureBlobStoreIpFinder.java
@@ -15,6 +15,15 @@ package org.apache.ignite.spi.discovery.tcp.ipfinder.azure;
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+import com.azure.storage.blob.BlobContainerClient;
+import com.azure.storage.blob.BlobServiceClient;
+import com.azure.storage.blob.BlobServiceClientBuilder;
+import com.azure.storage.blob.models.BlobErrorCode;
+import com.azure.storage.blob.models.BlobItem;
+import com.azure.storage.blob.models.BlobStorageException;
+import com.azure.storage.blob.specialized.BlockBlobClient;
+import com.azure.storage.common.StorageSharedKeyCredential;
import java.io.ByteArrayInputStream;
import java.io.UnsupportedEncodingException;
import java.net.InetSocketAddress;
@@ -23,19 +32,9 @@ import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicBoolean;
-
-import com.azure.storage.blob.BlobContainerClient;
-import com.azure.storage.blob.BlobServiceClient;
-import com.azure.storage.blob.BlobServiceClientBuilder;
-import com.azure.storage.blob.models.BlobErrorCode;
-import com.azure.storage.blob.models.BlobItem;
-import com.azure.storage.blob.models.BlobStorageException;
-import com.azure.storage.blob.specialized.BlockBlobClient;
-import com.azure.storage.common.StorageSharedKeyCredential;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
import org.apache.ignite.internal.util.typedef.F;
@@ -121,16 +120,7 @@ public class TcpDiscoveryAzureBlobStoreIpFinder extends TcpDiscoveryIpFinderAdap
Collection<InetSocketAddress> addrs = new ArrayList<>();
Set<String> seenBlobNames = new HashSet<>();
- Iterator<BlobItem> blobItemIterator = blobContainerClient.listBlobs().iterator();
-
- while (blobItemIterator.hasNext()) {
- BlobItem blobItem = blobItemIterator.next();
-
- // https://github.com/Azure/azure-sdk-for-java/issues/20515
- if (seenBlobNames.contains(blobItem.getName())) {
- break;
- }
-
+ for (BlobItem blobItem : blobContainerClient.listBlobs()) {
try {
if (!blobItem.isDeleted()) {
addrs.add(addrFromString(blobItem.getName()));
diff --git a/modules/azure-ext/src/test/java/org/apache/ignite/testsuites/IgniteAzureTestSuite.java b/modules/azure-ext/src/test/java/org/apache/ignite/testsuites/IgniteAzureTestSuite.java
index 0549568..2bc01a9 100644
--- a/modules/azure-ext/src/test/java/org/apache/ignite/testsuites/IgniteAzureTestSuite.java
+++ b/modules/azure-ext/src/test/java/org/apache/ignite/testsuites/IgniteAzureTestSuite.java
@@ -16,6 +16,7 @@ package org.apache.ignite.testsuites;
* limitations under the License.
*/
+import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.spi.discovery.tcp.ipfinder.azure.TcpDiscoveryAzureBlobStoreIpFinderSelfTest;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@@ -30,7 +31,7 @@ public class IgniteAzureTestSuite {
* @return Account Name
*/
public static String getAccountName() {
- String id = System.getenv("test.azure.account.name");
+ String id = X.getSystemOrEnv("test.azure.account.name");
assert id != null : "Environment variable 'test.azure.account.name' is not set";
@@ -41,7 +42,7 @@ public class IgniteAzureTestSuite {
* @return Account Key
*/
public static String getAccountKey() {
- String path = System.getenv("test.azure.account.key");
+ String path = X.getSystemOrEnv("test.azure.account.key");
assert path != null : "Environment variable 'test.azure.account.key' is not set";
@@ -52,7 +53,7 @@ public class IgniteAzureTestSuite {
* @return Endpoint
*/
public static String getEndpoint() {
- String name = System.getenv("test.azure.endpoint");
+ String name = X.getSystemOrEnv("test.azure.endpoint");
assert name != null : "Environment variable 'test.azure.endpoint' is not set";
diff --git a/modules/gce-ext/README.txt b/modules/gce-ext/README.txt
index 224c8ba..8e4d2fd 100644
--- a/modules/gce-ext/README.txt
+++ b/modules/gce-ext/README.txt
@@ -9,6 +9,15 @@ Depending on how you use Ignite, you can an extension using one of the following
- Add libraries from lib/optional/{module-dir} to the classpath of your application.
- Add a module as a Maven dependency to your project.
+
+Building GCE Module And Running Tests
+---------------------------------------
+
+To build and run GCE extension use the command below with the right credentials to the GCE service:
+
+mvn clean package -pl modules/gce-ext -Dtest.gce.account.id=id -Dtest.gce.p12.path=path -Dtest.gce.project.name=name
+
+
Importing GCE Module In Maven Project
-------------------------------------
diff --git a/modules/gce-ext/modules/core/src/test/config/log4j-test.xml b/modules/gce-ext/modules/core/src/test/config/log4j-test.xml
new file mode 100644
index 0000000..cc2146e
--- /dev/null
+++ b/modules/gce-ext/modules/core/src/test/config/log4j-test.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN"
+ "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="DEBUG"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="[%d{ISO8601}][%-5p][%t][%c{1}] %m%n"/>
+ </layout>
+
+ <filter class="org.apache.log4j.varia.LevelRangeFilter">
+ <param name="levelMin" value="DEBUG"/>
+ <param name="levelMax" value="INFO"/>
+ </filter>
+ </appender>
+
+ <appender name="CONSOLE_ERR" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.err"/>
+
+ <param name="Threshold" value="WARN"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="[%d{ISO8601}][%-5p][%t][%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <category name="org">
+ <level value="INFO"/>
+ </category>
+
+ <root>
+ <level value="INFO"/>
+
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="CONSOLE_ERR"/>
+ </root>
+</log4j:configuration>
diff --git a/modules/gce-ext/modules/core/src/test/config/tests.properties b/modules/gce-ext/modules/core/src/test/config/tests.properties
new file mode 100644
index 0000000..86094c8
--- /dev/null
+++ b/modules/gce-ext/modules/core/src/test/config/tests.properties
@@ -0,0 +1,16 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
diff --git a/modules/gce-ext/src/test/java/org/apache/ignite/testsuites/IgniteGCETestSuite.java b/modules/gce-ext/src/test/java/org/apache/ignite/testsuites/IgniteGCETestSuite.java
index 8d6cbe5..98680e5 100644
--- a/modules/gce-ext/src/test/java/org/apache/ignite/testsuites/IgniteGCETestSuite.java
+++ b/modules/gce-ext/src/test/java/org/apache/ignite/testsuites/IgniteGCETestSuite.java
@@ -17,6 +17,7 @@
package org.apache.ignite.testsuites;
+import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.spi.discovery.tcp.ipfinder.gce.TcpDiscoveryGoogleStorageIpFinderSelfTest;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@@ -31,7 +32,7 @@ public class IgniteGCETestSuite {
* @return Service Account Id.
*/
public static String getServiceAccountId() {
- String id = System.getenv("test.gce.account.id");
+ String id = X.getSystemOrEnv("test.gce.account.id");
assert id != null : "Environment variable 'test.gce.account.id' is not set";
@@ -42,7 +43,7 @@ public class IgniteGCETestSuite {
* @return Service Account p12 file path.
*/
public static String getP12FilePath() {
- String path = System.getenv("test.gce.p12.path");
+ String path = X.getSystemOrEnv("test.gce.p12.path");
assert path != null : "Environment variable 'test.gce.p12.path' is not set";
@@ -53,7 +54,7 @@ public class IgniteGCETestSuite {
* @return GCE project name.
*/
public static String getProjectName() {
- String name = System.getenv("test.gce.project.name");
+ String name = X.getSystemOrEnv("test.gce.project.name");
assert name != null : "Environment variable 'test.gce.project.name' is not set";
diff --git a/parent/pom.xml b/parent/pom.xml
index 683d8e9..12ef2e1 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -83,7 +83,7 @@
<hamcrest.version>1.2</hamcrest.version>
<httpclient.version>4.5.1</httpclient.version>
<httpcore.version>4.4.3</httpcore.version>
- <jackson.version>2.9.6</jackson.version>
+ <jackson.version>2.13.0</jackson.version>
<jackson1.version>1.9.13</jackson1.version>
<jaxb.api.version>2.1</jaxb.api.version>
<jaxb.impl.version>2.1.14</jaxb.impl.version>