This is an automated email from the ASF dual-hosted git repository.

sai_boorlagadda pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new faa6fe4571 GEODE-10441: Migrate integrationTest to Github Action 
(#7872)
faa6fe4571 is described below

commit faa6fe4571c8335f36107862d6423fc460c0b8e7
Author: Sai Boorlagadda <sai_boorlaga...@apache.org>
AuthorDate: Mon Feb 13 21:28:07 2023 -0800

    GEODE-10441: Migrate integrationTest to Github Action (#7872)
    
    * Added integrationTest job that depends on both
      apiCheck and unitTest
    
    * Made unitTest depend on build so it can be
      parallel to apiCheck
---
 .github/workflows/gradle.yml                       | 50 ++++++++++++++++++-
 .../test/concurrency/ConcurrentTestRunnerTest.java | 58 ----------------------
 2 files changed, 48 insertions(+), 60 deletions(-)

diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml
index 1503bf8891..90594bf398 100644
--- a/.github/workflows/gradle.yml
+++ b/.github/workflows/gradle.yml
@@ -83,7 +83,7 @@ jobs:
            japicmp --console=plain --no-daemon
 
   unitTest:
-   needs: apiCheck
+   needs: build
    strategy:
      fail-fast: false
      matrix:
@@ -137,4 +137,50 @@ jobs:
      with:
        name: unit-test-reports-${{ matrix.os }}-${{ matrix.java }}
        path: build/reports
-       retention-days: 5
\ No newline at end of file
+       retention-days: 5
+
+  integrationTest:
+     needs: [apiCheck, unitTest]
+     strategy:
+       matrix:
+         os: [ubuntu-latest]
+         distribution: ['liberica']
+         java: ['8']
+     runs-on: ${{ matrix.os }}
+     steps:
+     - uses: actions/checkout@v3
+     - name: Set up JDK
+       uses: actions/setup-java@v3
+       with:
+         distribution: ${{ matrix.distribution }}
+         java-version: |
+           8
+           11
+           17
+     - name: Setup Gradle
+       uses: gradle/gradle-build-action@v2
+     - name: Run integration tests
+       run: |
+         GRADLE_JVM_PATH=${JAVA_HOME_8_X64}
+         JAVA_BUILD_PATH=${JAVA_HOME_8_X64}
+         JAVA_BUILD_VERSION=8
+         JAVA_TEST_VERSION=${{ matrix.java }}
+         cp gradlew gradlewStrict
+         sed -e 's/JAVA_HOME/GRADLE_JVM/g' -i.back gradlewStrict
+         GRADLE_JVM=${GRADLE_JVM_PATH} JAVA_TEST_PATH=${JAVA_TEST_PATH} 
./gradlewStrict \
+           --no-parallel \
+           --max-workers=12 \
+           -PcompileJVM=${JAVA_BUILD_PATH} \
+           -PcompileJVMVer=${JAVA_BUILD_VERSION} \
+           -PtestJVM=${JAVA_TEST_PATH} \
+           -PtestJVMVer=${JAVA_TEST_VERSION} \
+           -PtestJava8Home=${JAVA_HOME_8_X64} \
+           -PtestJava11Home=${JAVA_HOME_11_X64} \
+           -PtestJava17Home=${JAVA_HOME_17_X64} \
+           integrationTest --console=plain --no-daemon
+     - uses: actions/upload-artifact@v3
+       if: failure()
+       with:
+         name: integration-test-reports-${{ matrix.os }}-${{ matrix.java }}
+         path: build/reports
+         retention-days: 5
\ No newline at end of file
diff --git 
a/geode-concurrency-test/src/integrationTest/java/org/apache/geode/test/concurrency/ConcurrentTestRunnerTest.java
 
b/geode-concurrency-test/src/integrationTest/java/org/apache/geode/test/concurrency/ConcurrentTestRunnerTest.java
deleted file mode 100644
index 8840cc56f1..0000000000
--- 
a/geode-concurrency-test/src/integrationTest/java/org/apache/geode/test/concurrency/ConcurrentTestRunnerTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.geode.test.concurrency;
-
-import static org.apache.geode.test.concurrency.Utilities.availableProcessors;
-import static org.assertj.core.api.Assertions.assertThat;
-
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.junit.Test;
-import org.junit.runner.JUnitCore;
-import org.junit.runner.RunWith;
-
-public class ConcurrentTestRunnerTest {
-  @Test
-  public void confirmThatInParallelRunsConcurrently() {
-    // We only need FailingTest to fail once for the following
-    // assertion to pass. ConcurrentTestRunner runs FailingTest
-    // 2000 times by default. It will stop running it once it
-    // sees it fail, which is what we want to see because it
-    // confirms that running inParallel actually runs concurrently.
-    
assertThat(JUnitCore.runClasses(CheckForConcurrency.class).wasSuccessful()).isFalse();
-  }
-
-  /**
-   * This "test" is only meant to be run by 
confirmThatInParallelRunsConcurrently.
-   * If you run this "test" directly you can expect to see if fail.
-   */
-  @RunWith(ConcurrentTestRunner.class)
-  public static class CheckForConcurrency {
-    @Test
-    public void validateConcurrentExecution(ParallelExecutor executor)
-        throws ExecutionException, InterruptedException {
-      final AtomicInteger atomicInteger = new AtomicInteger(0);
-      executor.inParallel(() -> {
-        int oldValue = atomicInteger.get();
-        // We want to see the following assertion fail because that indicates
-        // that another thread currently modified the atomic.
-        assertThat(atomicInteger.compareAndSet(oldValue, oldValue + 
1)).isTrue();
-      }, availableProcessors());
-      executor.execute();
-    }
-  }
-}

Reply via email to