From efc7c83f16210b264db718dae172a92674277e12 Mon Sep 17 00:00:00 2001 From: shinyano <12236590+shinyano@users.noreply.github.com> Date: Tue, 7 May 2024 20:34:18 +0800 Subject: [PATCH] restore all tests --- .github/workflows/DB-CE.yml | 213 +++++++++--------- .github/workflows/case-regression.yml | 67 ++++++ .github/workflows/codeql.yml | 79 +++++++ .../workflows/standalone-test-pushdown.yml | 91 ++++++++ .github/workflows/standalone-test.yml | 171 ++++++++++++++ .github/workflows/unit-mds.yml | 88 ++++++++ .github/workflows/unit-test.yml | 34 +++ 7 files changed, 635 insertions(+), 108 deletions(-) create mode 100644 .github/workflows/case-regression.yml create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/standalone-test-pushdown.yml create mode 100644 .github/workflows/standalone-test.yml create mode 100644 .github/workflows/unit-mds.yml create mode 100644 .github/workflows/unit-test.yml diff --git a/.github/workflows/DB-CE.yml b/.github/workflows/DB-CE.yml index ba4dcb73cc..22511ba399 100644 --- a/.github/workflows/DB-CE.yml +++ b/.github/workflows/DB-CE.yml @@ -20,21 +20,17 @@ jobs: matrix: java: [8] python-version: ["3.9"] - os: [ubuntu-latest] + os: [ubuntu-latest, macos-13, windows-latest] DB-name: [ - "PostgreSQL", - "Redis", + "FileSystem", + "IoTDB12", + "InfluxDB", + "PostgreSQL", + "Redis", + "MongoDB", + "Parquet", ] -# [ -# "FileSystem", -# "IoTDB12", -# "InfluxDB", -# "PostgreSQL", -# "Redis", -# "MongoDB", -# "Parquet", -# ] metadata: [zookeeper] runs-on: ${{ matrix.os }} env: @@ -62,6 +58,102 @@ jobs: run: | mvn clean package -DskipTests -P-format -q + # 第 1 阶段测试开始========================================== + - name: Prepare CapExp environment oriHasDataExpHasData + uses: ./.github/actions/capacityExpansionUnionTest + with: + version: ${VERSION} + DB-name: ${{ matrix.DB-name }} + Test-Way: oriHasDataExpHasData + + - name: oriHasDataExpHasData IT + shell: bash + run: | + mvn test -q -Dtest=${{ matrix.DB-name }}CapacityExpansionIT#oriHasDataExpHasData -DfailIfNoTests=false -P-format + + - name: Clear history data + uses: ./.github/actions/dbWriter + with: + DB-name: ${{ matrix.DB-name }} + Test-Way: clearHistoryData + + - name: oriHasDataExpHasData Normal IT + shell: bash + run: | + mvn test -q -Dtest=${FUNCTEST} -DfailIfNoTests=false -P-format + + # 第 2 阶段测试开始========================================== + - name: Prepare CapExp environment oriNoDataExpNoData + uses: ./.github/actions/capacityExpansionUnionTest + with: + version: ${VERSION} + DB-name: ${{ matrix.DB-name }} + Test-Way: oriNoDataExpNoData + + - name: oriNoDataExpNoData IT + shell: bash + run: | + mvn test -q -Dtest=${{ matrix.DB-name }}CapacityExpansionIT#oriNoDataExpNoData -DfailIfNoTests=false -P-format + + - name: Clear history data + uses: ./.github/actions/dbWriter + with: + DB-name: ${{ matrix.DB-name }} + Test-Way: clearHistoryData + + - name: oriNoDataExpNoData Normal IT + shell: bash + run: | + mvn test -q -Dtest=${FUNCTEST} -DfailIfNoTests=false -P-format + + # 第 3 阶段测试开始========================================== + - name: Prepare CapExp environment oriHasDataExpNoData + uses: ./.github/actions/capacityExpansionUnionTest + with: + version: ${VERSION} + DB-name: ${{ matrix.DB-name }} + Test-Way: oriHasDataExpNoData + + - name: oriHasDataExpNoData IT + shell: bash + run: | + mvn test -q -Dtest=${{ matrix.DB-name }}CapacityExpansionIT#oriHasDataExpNoData -DfailIfNoTests=false -P-format + + - name: Clear history data + uses: ./.github/actions/dbWriter + with: + DB-name: ${{ matrix.DB-name }} + Test-Way: clearHistoryData + + - name: oriHasDataExpNoData Normal IT + shell: bash + run: | + mvn test -q -Dtest=${FUNCTEST} -DfailIfNoTests=false -P-format + + # 第 4 阶段测试开始========================================== + - name: Prepare CapExp environment oriNoDataExpHasData + uses: ./.github/actions/capacityExpansionUnionTest + with: + version: ${VERSION} + DB-name: ${{ matrix.DB-name }} + Test-Way: oriNoDataExpHasData + + - name: oriNoDataExpHasData IT + shell: bash + run: | + mvn test -q -Dtest=${{ matrix.DB-name }}CapacityExpansionIT#oriNoDataExpHasData -DfailIfNoTests=false -P-format + + - name: Clear history data + uses: ./.github/actions/dbWriter + with: + DB-name: ${{ matrix.DB-name }} + Test-Way: clearHistoryData + + - name: oriNoDataExpHasData Normal IT + shell: bash + run: | + mvn test -q -Dtest=${FUNCTEST} -DfailIfNoTests=false -P-format + # 测试只读节点=============================================== - name: Prepare CapExp environment for testReadOnly uses: ./.github/actions/capacityExpansionUnionTest @@ -75,6 +167,7 @@ jobs: shell: bash run: | mvn test -q -Dtest=${{ matrix.DB-name }}CapacityExpansionIT#testReadOnly -DfailIfNoTests=false -P-format + mvn test -q -Dtest=${FUNCTEST} -DfailIfNoTests=false -P-format - name: Show IGinX log if: always() @@ -92,99 +185,3 @@ jobs: with: file: ./**/target/site/jacoco/jacoco.xml name: codecov -# mvn test -q -Dtest=${FUNCTEST} -DfailIfNoTests=false -P-format -# # 第 1 阶段测试开始========================================== -# - name: Prepare CapExp environment oriHasDataExpHasData -# uses: ./.github/actions/capacityExpansionUnionTest -# with: -# version: ${VERSION} -# DB-name: ${{ matrix.DB-name }} -# Test-Way: oriHasDataExpHasData -# -# - name: oriHasDataExpHasData IT -# shell: bash -# run: | -# mvn test -q -Dtest=${{ matrix.DB-name }}CapacityExpansionIT#oriHasDataExpHasData -DfailIfNoTests=false -P-format -# -# - name: Clear history data -# uses: ./.github/actions/dbWriter -# with: -# DB-name: ${{ matrix.DB-name }} -# Test-Way: clearHistoryData -# -# - name: oriHasDataExpHasData Normal IT -# shell: bash -# run: | -# mvn test -q -Dtest=${FUNCTEST} -DfailIfNoTests=false -P-format -# -# # 第 2 阶段测试开始========================================== -# - name: Prepare CapExp environment oriNoDataExpNoData -# uses: ./.github/actions/capacityExpansionUnionTest -# with: -# version: ${VERSION} -# DB-name: ${{ matrix.DB-name }} -# Test-Way: oriNoDataExpNoData -# -# - name: oriNoDataExpNoData IT -# shell: bash -# run: | -# mvn test -q -Dtest=${{ matrix.DB-name }}CapacityExpansionIT#oriNoDataExpNoData -DfailIfNoTests=false -P-format -# -# - name: Clear history data -# uses: ./.github/actions/dbWriter -# with: -# DB-name: ${{ matrix.DB-name }} -# Test-Way: clearHistoryData -# -# - name: oriNoDataExpNoData Normal IT -# shell: bash -# run: | -# mvn test -q -Dtest=${FUNCTEST} -DfailIfNoTests=false -P-format -# -# # 第 3 阶段测试开始========================================== -# - name: Prepare CapExp environment oriHasDataExpNoData -# uses: ./.github/actions/capacityExpansionUnionTest -# with: -# version: ${VERSION} -# DB-name: ${{ matrix.DB-name }} -# Test-Way: oriHasDataExpNoData -# -# - name: oriHasDataExpNoData IT -# shell: bash -# run: | -# mvn test -q -Dtest=${{ matrix.DB-name }}CapacityExpansionIT#oriHasDataExpNoData -DfailIfNoTests=false -P-format -# -# - name: Clear history data -# uses: ./.github/actions/dbWriter -# with: -# DB-name: ${{ matrix.DB-name }} -# Test-Way: clearHistoryData -# -# - name: oriHasDataExpNoData Normal IT -# shell: bash -# run: | -# mvn test -q -Dtest=${FUNCTEST} -DfailIfNoTests=false -P-format -# -# # 第 4 阶段测试开始========================================== -# - name: Prepare CapExp environment oriNoDataExpHasData -# uses: ./.github/actions/capacityExpansionUnionTest -# with: -# version: ${VERSION} -# DB-name: ${{ matrix.DB-name }} -# Test-Way: oriNoDataExpHasData -# -# - name: oriNoDataExpHasData IT -# shell: bash -# run: | -# mvn test -q -Dtest=${{ matrix.DB-name }}CapacityExpansionIT#oriNoDataExpHasData -DfailIfNoTests=false -P-format -# -# - name: Clear history data -# uses: ./.github/actions/dbWriter -# with: -# DB-name: ${{ matrix.DB-name }} -# Test-Way: clearHistoryData -# -# - name: oriNoDataExpHasData Normal IT -# shell: bash -# run: | -# mvn test -q -Dtest=${FUNCTEST} -DfailIfNoTests=false -P-format diff --git a/.github/workflows/case-regression.yml b/.github/workflows/case-regression.yml new file mode 100644 index 0000000000..474a112472 --- /dev/null +++ b/.github/workflows/case-regression.yml @@ -0,0 +1,67 @@ +name: "Bug Regression Test" + +on: + pull_request: + types: [opened, reopened] + branches: + - main +env: + VERSION: 0.6.0-SNAPSHOT + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + MixCluster-ShowTimeseries: + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + java: [8] + python-version: ["3.9"] + os: [ubuntu-latest, macos-13, windows-latest] + metadata: [zookeeper] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: Environment dependence + uses: ./.github/actions/dependence + with: + python-version: ${{ matrix.python-version }} + java: ${{ matrix.java }} + + - name: Run Metadata + uses: ./.github/actions/metadataRunner + with: + metadata: ${{ matrix.metadata }} + + - name: Run DB + uses: ./.github/actions/dbRunner + with: + DB-name: "Mix-IoTDB12-InfluxDB" + + - name: Install IGinX with Maven + shell: bash + run: | + mvn clean package -DskipTests -P-format -q + + - name: Write Conf + uses: ./.github/actions/confWriter + with: + Metadata: ${{ matrix.metadata }} + + - name: Start IGinX + uses: ./.github/actions/iginxRunner + + - name: TestMixCluster + if: always() + shell: bash + run: | + mvn test -q -Dtest=MixClusterShowColumnsRegressionTest -DfailIfNoTests=false -P-format + + - name: Show IGinX log + if: always() + shell: bash + run: | + cat iginx-*.log diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000000..4861a044d6 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,79 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + pull_request: + types: [opened, reopened] + branches: ["main"] + +jobs: + analyze: + name: Analyze + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners + # Consider using larger runners for possible analysis time improvements. + runs-on: ${{ (matrix.language == 'swift' && 'macos-13') || 'ubuntu-latest' }} + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} + permissions: + # required for all workflows + security-events: write + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + language: ["java-kotlin", "python"] + # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] + # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/standalone-test-pushdown.yml b/.github/workflows/standalone-test-pushdown.yml new file mode 100644 index 0000000000..148995a895 --- /dev/null +++ b/.github/workflows/standalone-test-pushdown.yml @@ -0,0 +1,91 @@ +name: "Union Database Test With Push Down" +on: + pull_request: + types: [opened, reopened] + branches: + - main +env: + VERSION: 0.6.0-SNAPSHOT +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + Union-DB-Test-Push_Down: + timeout-minutes: 35 + strategy: + fail-fast: false + matrix: + java: [8] + python-version: ["3.9"] + os: [ubuntu-latest, macos-13, windows-latest] + DB-name: + [ + "IoTDB12", + "InfluxDB", + "Redis", + "Parquet", + "PostgreSQL", + "FileSystem", + "MongoDB", + ] + metadata: [zookeeper] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: Environment dependence + uses: ./.github/actions/dependence + with: + python-version: ${{ matrix.python-version }} + java: ${{ matrix.java }} + + - if: runner.os == 'Windows' + name: Set JAVA_OPTS + run: echo "JAVA_OPTS=-Xmx4g -Xmx2g" >> $GITHUB_ENV + + - name: Run Metadata + uses: ./.github/actions/metadataRunner + with: + metadata: ${{ matrix.metadata }} + + - name: Run DB + uses: ./.github/actions/dbRunner + with: + DB-name: ${{ matrix.DB-name }} + + - name: Install IGinX with Maven + shell: bash + run: | + mvn clean package -DskipTests -P-format -q + + - name: Change IGinX config + uses: ./.github/actions/confWriter + with: + DB-name: ${{ matrix.DB-name }} + Push-Down: "true" + Set-Filter-Fragment-OFF: "true" + Metadata: ${{ matrix.metadata }} + + - name: Start IGinX + uses: ./.github/actions/iginxRunner + + - name: TestController IT + if: always() + shell: bash + env: + METADATA_STORAGE: ${{ matrix.metadata }} + run: | + chmod +x "${GITHUB_WORKSPACE}/.github/scripts/test/test_union.sh" + mvn test -q -Dtest=Controller -DfailIfNoTests=false -P-format + + - name: Show test result + if: always() + shell: bash + run: | + cat ${GITHUB_WORKSPACE}/test/src/test/resources/testResult.txt + + - name: Show IGinX log + if: always() + shell: bash + run: | + cat iginx-*.log diff --git a/.github/workflows/standalone-test.yml b/.github/workflows/standalone-test.yml new file mode 100644 index 0000000000..b14d6329eb --- /dev/null +++ b/.github/workflows/standalone-test.yml @@ -0,0 +1,171 @@ +name: "Union Database Test" +on: + pull_request: + types: [opened, reopened] + branches: + - main +env: + VERSION: 0.6.0-SNAPSHOT +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + Union-DB-Test: + timeout-minutes: 40 + strategy: + fail-fast: false + matrix: + java: [8] + python-version: ["3.9"] + os: [ubuntu-latest, macos-13, windows-latest] + DB-name: + [ + "IoTDB12", + "InfluxDB", + "Parquet", + "PostgreSQL", + "FileSystem", + "Redis", + "MongoDB", + ] + metadata: [zookeeper] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: Environment dependence + uses: ./.github/actions/dependence + with: + python-version: ${{ matrix.python-version }} + java: ${{ matrix.java }} + + - name: Run Metadata + uses: ./.github/actions/metadataRunner + with: + metadata: ${{ matrix.metadata }} + + - name: Run DB + uses: ./.github/actions/dbRunner + with: + DB-name: ${{ matrix.DB-name }} + + - name: Install IGinX with Maven + shell: bash + run: | + mvn clean package -DskipTests -P-format -q + + - name: Change IGinX config + uses: ./.github/actions/confWriter + with: + DB-name: ${{ matrix.DB-name }} + Set-Filter-Fragment-OFF: "true" + Metadata: ${{ matrix.metadata }} + + # start udf path test first to avoid being effected + - name: Start IGinX + uses: ./.github/actions/iginxRunner + with: + version: ${VERSION} + if-test-udf: "true" + + - name: Run UDF path test + if: always() + shell: bash + run: | + mvn test -q -Dtest=UDFPathIT -DfailIfNoTests=false -P-format + if [ "$RUNNER_OS" == "Linux" ]; then + chmod +x "${GITHUB_WORKSPACE}/.github/scripts/test/cli/test_py_register.sh" + "${GITHUB_WORKSPACE}/.github/scripts/test/cli/test_py_register.sh" + elif [ "$RUNNER_OS" == "Windows" ]; then + chmod +x "${GITHUB_WORKSPACE}/.github/scripts/test/cli/test_py_register_windows.sh" + "${GITHUB_WORKSPACE}/.github/scripts/test/cli/test_py_register_windows.sh" + elif [ "$RUNNER_OS" == "macOS" ]; then + chmod +x "${GITHUB_WORKSPACE}/.github/scripts/test/cli/test_py_register_macos.sh" + "${GITHUB_WORKSPACE}/.github/scripts/test/cli/test_py_register_macos.sh" + fi + + - name: set client test context + uses: ./.github/actions/context + with: + work-name: restart-iginx-meta + metadata: ${{ matrix.metadata }} + + - name: set client test context + uses: ./.github/actions/context + with: + DB-name: ${{ matrix.DB-name }} + shell: client-before + + # large image export only tested in FileSystem and Parquet + - name: Test Client Export File + if: always() + shell: bash + run: | + if [[ "${{ matrix.DB-name }}" == "FileSystem" || "${{ matrix.DB-name }}" == "Parquet" ]]; then + mvn test -q -Dtest=ExportFileIT -DfailIfNoTests=false -P-format + else + mvn test -q -Dtest=ExportFileIT#checkExportByteStream -DfailIfNoTests=false -P-format + mvn test -q -Dtest=ExportFileIT#checkExportCsv -DfailIfNoTests=false -P-format + fi + + - name: Stop IGinX and Metadata, Clear Metadata Data, then Start Them + uses: ./.github/actions/context + with: + work-name: restart-iginx-meta + metadata: ${{ matrix.metadata }} + + - name: set client test context + uses: ./.github/actions/context + with: + shell: client-after + + - name: Test Client Import File + if: always() + shell: bash + run: | + mvn test -q -Dtest=ImportFileIT -DfailIfNoTests=false -P-format + + - name: clean metadata and restart IGinX + uses: ./.github/actions/context + with: + work-name: restart-iginx-meta + metadata: ${{ matrix.metadata }} + + - name: TestController IT + if: always() + shell: bash + env: + METADATA_STORAGE: ${{ matrix.metadata }} + run: | + chmod +x "${GITHUB_WORKSPACE}/.github/scripts/test/test_union.sh" + mvn test -q -Dtest=Controller -DfailIfNoTests=false -P-format + + - name: Change IGinX config + uses: ./.github/actions/confWriter + with: + Set-Key-Range-Test-Policy: "true" + + - name: clean metadata and restart IGinX + uses: ./.github/actions/context + with: + work-name: restart-iginx-meta + metadata: ${{ matrix.metadata }} + + - name: FilterFragmentRuleTest IT + if: always() + shell: bash + run: | + chmod +x "${GITHUB_WORKSPACE}/.github/scripts/test/test_union.sh" + mvn test -q -Dtest=SQLSessionIT#testFilterFragmentOptimizer -DfailIfNoTests=false -P-format + + - name: Show test result + if: always() + shell: bash + run: | + cat ${GITHUB_WORKSPACE}/test/src/test/resources/testResult.txt + + - name: Show IGinX log + if: always() + shell: bash + run: | + cat iginx-*.log diff --git a/.github/workflows/unit-mds.yml b/.github/workflows/unit-mds.yml new file mode 100644 index 0000000000..521f20afdb --- /dev/null +++ b/.github/workflows/unit-mds.yml @@ -0,0 +1,88 @@ +name: "Metadata-Service-Test" + +on: + pull_request: + types: [opened, reopened] + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + ZK-Test: + strategy: + fail-fast: false + matrix: + java: [8] + os: [ubuntu-latest, windows-latest, macos-13] + runs-on: ${{ matrix.os}} + env: + STORAGE: zookeeper + ZOOKEEPER_CONNECTION_STRING: 127.0.0.1:2181 + steps: + - uses: actions/checkout@v2 + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + + - name: Cache Maven packages + uses: actions/cache@v2 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + + - name: Run ZooKeeper + uses: ./.github/actions/zookeeperRunner + - name: Run test for meta manager + run: mvn test -q -Dtest=IMetaManagerTest -DfailIfNoTests=false -P-format + + - name: Run test for sync protocol + run: mvn test -q -Dtest=ZooKeeperSyncProtocolTest -DfailIfNoTests=false -P-format + + - uses: codecov/codecov-action@v1 + with: + file: ./**/target/site/jacoco/jacoco.xml + name: codecov + + ETCD-Test: + strategy: + fail-fast: false + max-parallel: 20 + matrix: + java: [8] + os: [ubuntu-latest, windows-latest, macos-13] + runs-on: ${{ matrix.os}} + env: + STORAGE: etcd + ETCD_ENDPOINTS: http://localhost:2379 + steps: + - uses: actions/checkout@v2 + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + + - name: Cache Maven packages + uses: actions/cache@v2 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + + - name: Run ETCD + uses: ./.github/actions/etcdRunner + + - name: Run test for meta manager + run: mvn test -q -Dtest=IMetaManagerTest -DfailIfNoTests=false -P-format + + - name: Run test for sync protocol + run: mvn test -q -Dtest=ETCDSyncProtocolTest -DfailIfNoTests=false -P-format + + - uses: codecov/codecov-action@v1 + with: + file: ./**/target/site/jacoco/jacoco.xml + name: codecov diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml new file mode 100644 index 0000000000..5d3cc6d68e --- /dev/null +++ b/.github/workflows/unit-test.yml @@ -0,0 +1,34 @@ +name: "UTTest" + +on: + pull_request: + types: [opened, reopened] + branches: + - main +env: + VERSION: 0.6.0-SNAPSHOT + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + Unit-Test: + strategy: + fail-fast: false + matrix: + java: [8] + python-version: ["3.9"] + os: [ubuntu-latest, macos-13, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: Environment dependence + uses: ./.github/actions/dependence + with: + python-version: ${{ matrix.python-version }} + java: ${{ matrix.java }} + + - name: Test with Maven + run: | + mvn clean package -pl core -am -P-format -q