Skip to content

Commit

Permalink
Support Testcontainers framework in junit testings
Browse files Browse the repository at this point in the history
### What changes are proposed in this pull request?

Add testcontainers test support for relevant unit testings.

### Why are the changes needed?

For certain junit test suites such as etcd related, testcontainers framework needs to be supported

### Does this PR introduce any user facing changes?

N/A

			pr-link: #17977
			change-id: cid-ba36ad7f742b1b5370da43b68574be0ff88ead04
  • Loading branch information
lucyge2022 authored Aug 15, 2023
1 parent 459a6e9 commit 7a4f602
Show file tree
Hide file tree
Showing 247 changed files with 850 additions and 351 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/java8_container_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Java 8 Container Tests

# This build runs integration tests using testcontainers
# The user executing the test command must have access to a running docker daemon

on: [pull_request]

jobs:
build:
name: "modules: "

strategy:
fail-fast: false
matrix:
modules:
- >-
alluxio.membership.**
runs-on: ubuntu-latest
if: "!contains(github.event.pull_request.title, 'DOCFIX') &&
!contains(github.event.pull_request.title, 'SKIPCI')"

steps:
- name: checkout repo
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: '10.11.0'

- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-java11-${{ hashFiles('**/pom.xml') }}

- name: Cache local Go modules
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-gomod-${{ hashFiles('**/go.mod') }}

- name: Run tests
id: test0
run: |
mkdir -p ~/.m2
ALLUXIO_DOCKER_NO_TTY=true \
ALLUXIO_DOCKER_GIT_CLEAN=true \
ALLUXIO_DOCKER_ID=0 \
ALLUXIO_DOCKER_MVN_PROJECT_LIST=dora/tests/testcontainers \
ALLUXIO_DOCKER_MVN_TESTS=${{ matrix.modules }} \
dev/github/run_docker.sh
timeout-minutes: 60

- name: Archive artifacts
continue-on-error: true
uses: actions/upload-artifact@v3
if: always()
with:
name: artifact
path: |
**/target/surefire-reports/*
**/target/artifacts/*
**/target/logs/*
retention-days: 7
2 changes: 1 addition & 1 deletion .github/workflows/java8_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
mkdir -p ~/.m2
ALLUXIO_DOCKER_NO_TTY=true \
ALLUXIO_DOCKER_GIT_CLEAN=true \
ALLUXIO_DOCKER_MVN_PROJECT_LIST=\!assembly/client,\!assembly/server,\!dora/tests,\!dora/microbench,\!webui \
ALLUXIO_DOCKER_MVN_PROJECT_LIST=\!assembly/client,\!assembly/server,\!dora/tests/integration,\!dora/tests/testcontainers,\!dora/microbench,\!webui \
ALLUXIO_DOCKER_MVN_TESTS=${{ matrix.modules }} \
dev/github/run_docker.sh
timeout-minutes: 60
Expand Down
1 change: 1 addition & 0 deletions dev/github/run_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function main {
# configure anything that's relative to ${HOME}.
run_args+=" -e HOME=${home}"
run_args+=" -v ${ALLUXIO_DOCKER_M2}:${home}/.m2"
run_args+=" -v /var/run/docker.sock:/var/run/docker.sock"
run_args+=" -e npm_config_cache=${home}/.npm"
run_args+=" -e MAVEN_CONFIG=${home}/.m2"

Expand Down
2 changes: 1 addition & 1 deletion dora/microbench/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</dependency>
<dependency>
<groupId>org.alluxio</groupId>
<artifactId>alluxio-tests</artifactId>
<artifactId>alluxio-tests-integration</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
Expand Down
Loading

0 comments on commit 7a4f602

Please sign in to comment.