E2E Test #1467
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: E2E Test | |
on: | |
pull_request_target: | |
branches: [ "main" ] | |
# https://docs.github.com/zh/actions/using-workflows/workflow-syntax-for-github-actions#onschedule | |
# Automatically run tests every day at UTC 00:30 test before going to work(CST 08:30). | |
schedule: | |
- cron: "30 0 * * *" | |
workflow_dispatch: {} | |
# Executing tests concurrently is a resource-intensive thing. When we start a new Github Action, it always aborts the previous one. | |
concurrency: | |
group: holoinsight-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
e2e-test-server-image: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Cache maven repository | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-build-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-maven-build- | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'temurin' | |
- name: Build server | |
run: ./scripts/all-in-one/build.sh | |
- name: Build server docker image | |
run: | | |
nobuild=1 docker buildx build --load -t holoinsight/server:latest -f ./scripts/docker/Dockerfile . | |
docker save -o holoinsight-server.tar holoinsight/server:latest | |
- name: Upload server docker image | |
uses: actions/upload-artifact@v3 | |
with: | |
name: holoinsight-server | |
path: holoinsight-server.tar | |
# Warmup e2e maven repositories | |
e2e-test-warmup: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Cache maven repository | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-e2e-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-maven-e2e- | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'temurin' | |
- name: Warmup E2E tests | |
run: mvn clean integration-test -f server/server-parent -am -pl ../../test/server-e2e-test -Dgroups=it-warmup -DskipITs=false | |
- name: Cache common docker images | |
run: | | |
mkdir docker-images | |
./scripts/githubactions/pull-and-save-image.sh testcontainers/ryuk:0.3.4 ryuk.tar | |
./scripts/githubactions/pull-and-save-image.sh alpine/socat:1.7.4.3-r0 socat.tar | |
- name: Upload common docker images | |
uses: actions/upload-artifact@v3 | |
with: | |
name: common-docker-images | |
path: docker-images/*.tar | |
e2e-test: | |
runs-on: ubuntu-latest | |
needs: [ e2e-test-server-image, e2e-test-warmup ] | |
timeout-minutes: 15 | |
strategy: | |
fail-fast: false | |
matrix: | |
it: | |
- test: AuthIT | |
scene: scene-default | |
- test: LogMonitoringFolderIT | |
scene: scene-default | |
- test: MetaVMIT | |
scene: scene-default | |
- test: AppMonitoringIT | |
scene: scene-default | |
- test: AgentVMIT | |
scene: scene-default | |
- test: AlertRuleIT | |
scene: scene-default | |
- test: AlertCalculateIT | |
scene: scene-default | |
- test: OpenMetricsScraperIT | |
scene: scene-default | |
- test: AlertWebhookIT | |
scene: scene-default | |
- test: DashboardIT | |
scene: scene-default | |
- test: AlertDingDingRobotIT | |
scene: scene-default | |
- test: LogMonitoring_1_log_IT | |
scene: scene-default | |
- test: AlertGroupIT | |
scene: scene-default | |
- test: CeresdbPqlMonitoringIT | |
scene: scene-default | |
- test: MetricMonitoringIT | |
scene: scene-default | |
- test: apm.ApmCallLinkIT | |
scene: scene-default | |
- test: apm.ApmTopologyIT | |
scene: scene-default | |
- test: apm.ApmCallLinkDetailIT | |
scene: scene-default | |
- test: apm.ApmAppMetricStatIT | |
scene: scene-default | |
- test: LogMonitoringMultilineIT | |
scene: scene-default | |
- test: LogMonitoringAnalysisIT | |
scene: scene-default | |
- test: AlertLogAnalysisIT | |
scene: scene-default | |
- test: CustomPluginFacadeIT | |
scene: scene-default | |
- test: FolderFacadeIT | |
scene: scene-default | |
- test: AlertTemplateFacadeIT | |
scene: scene-default | |
- test: AlarmBlockFacadeIT | |
scene: scene-default | |
- test: AlarmMetricFacadeIT | |
scene: scene-default | |
- test: AlarmSubscribeFacadeIT | |
scene: scene-default | |
- test: AlertManagerWebhookIT | |
scene: scene-default | |
- test: ApiKeyFacadeIT | |
scene: scene-default | |
- test: DefaultTenantFacadeIT | |
scene: scene-default | |
- test: DisplayMenuFacadeIT | |
scene: scene-default | |
- test: DisplayTemplateFacadeIT | |
scene: scene-default | |
- test: InitFacadeIT | |
scene: scene-default | |
- test: IntegrationGeneratedFacadeIT | |
scene: scene-default | |
- test: IntegrationPluginFacadeIT | |
scene: scene-default | |
- test: IntegrationProductFacadeIT | |
scene: scene-default | |
- test: UserFavoriteFacadeIT | |
scene: scene-default | |
- test: UserinfoVerificationFacadeIT | |
scene: scene-default | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Cache maven repository | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-e2e-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-maven-e2e- | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'temurin' | |
- name: Download docker images | |
uses: actions/download-artifact@v3 | |
with: | |
path: artifacts | |
- name: Load docker images | |
run: find artifacts/ -name "*.tar" -exec docker load -i {} \; | |
- name: Setup environments | |
run: echo "${{ matrix.it.env }}" >> $GITHUB_ENV | |
- name: Run E2e Tests [${{ matrix.it.test }}] at scene [${{ matrix.it.scene }}] | |
# https://docs.github.com/zh/actions/using-workflows/workflow-commands-for-github-actions | |
run: | | |
./scripts/test/e2e/one.sh | |
env: | |
IT_CLASS: "${{ matrix.it.test }}" | |
IT_SCENE: "${{ matrix.it.scene }}" | |
e2e-test-merge-gate: | |
runs-on: ubuntu-latest | |
needs: [ e2e-test ] | |
steps: | |
- name: nothing | |
run: true |