This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new 5171d81b6ae [feat][ci] Add integration to ge.apache.org Gradle
Enterprise server (#19133)
5171d81b6ae is described below
commit 5171d81b6ae12fdb60530343de931b21de64169d
Author: Lari Hotari <[email protected]>
AuthorDate: Tue Jan 10 19:23:30 2023 +0200
[feat][ci] Add integration to ge.apache.org Gradle Enterprise server
(#19133)
---
.github/actions/gradle-enterprise/action.yml | 36 ++++++++++++
.github/workflows/ci-maven-cache-update.yaml | 7 +++
.github/workflows/ci-owasp-dependency-check.yaml | 9 ++-
.github/workflows/pulsar-ci-flaky.yaml | 7 +++
.github/workflows/pulsar-ci.yaml | 65 +++++++++++++++++++++-
.gitignore | 6 ++
.mvn/ge-extensions.xml | 34 +++++++++++
.mvn/gradle-enterprise-custom-user-data.groovy | 44 +++++++++++++++
.mvn/gradle-enterprise.xml | 47 ++++++++++++++++
.../apache/pulsar/client/api/SimpleSchemaTest.java | 16 ++----
...mpleSchemaWithSchemaValidationEnforcedTest.java | 28 ++++++++++
11 files changed, 286 insertions(+), 13 deletions(-)
diff --git a/.github/actions/gradle-enterprise/action.yml
b/.github/actions/gradle-enterprise/action.yml
new file mode 100644
index 00000000000..935e76d3cd6
--- /dev/null
+++ b/.github/actions/gradle-enterprise/action.yml
@@ -0,0 +1,36 @@
+#
+# 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.
+#
+
+name: Configure Gradle Enterprise integration
+description: Configure Gradle Enterprise when secret GE_ACCESS_TOKEN is
available
+inputs:
+ token:
+ description: 'The token for accessing Gradle Enterprise'
+ required: true
+runs:
+ using: composite
+ steps:
+ - run: |
+ if [[ -n "${{ inputs.token }}" ]]; then
+ echo "::group::Configuring Gradle Enterprise for build"
+ cp .mvn/ge-extensions.xml .mvn/extensions.xml
+ echo "GRADLE_ENTERPRISE_ACCESS_KEY=${{ inputs.token }}" >>
$GITHUB_ENV
+ echo "::endgroup::"
+ fi
+ shell: bash
\ No newline at end of file
diff --git a/.github/workflows/ci-maven-cache-update.yaml
b/.github/workflows/ci-maven-cache-update.yaml
index daba3dcc032..831a2866bea 100644
--- a/.github/workflows/ci-maven-cache-update.yaml
+++ b/.github/workflows/ci-maven-cache-update.yaml
@@ -47,6 +47,8 @@ env:
jobs:
update-maven-dependencies-cache:
name: Update Maven dependency cache for ${{ matrix.name }}
+ env:
+ JOB_NAME: Update Maven dependency cache for ${{ matrix.name }}
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 45
@@ -75,6 +77,11 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+ with:
+ token: ${{ secrets.GE_ACCESS_TOKEN }}
+
- name: Detect changed files
if: ${{ github.event_name != 'schedule' }}
id: changes
diff --git a/.github/workflows/ci-owasp-dependency-check.yaml
b/.github/workflows/ci-owasp-dependency-check.yaml
index 38bd7f9eec4..9ee9c8c46b3 100644
--- a/.github/workflows/ci-owasp-dependency-check.yaml
+++ b/.github/workflows/ci-owasp-dependency-check.yaml
@@ -28,7 +28,9 @@ env:
jobs:
run-owasp-dependency-check:
if: ${{ github.repository == 'apache/pulsar' }}
- name: Run OWASP Dependency Check
+ name: Run OWASP Dependency Check for ${{ matrix.name }}
+ env:
+ JOB_NAME: Run OWASP Dependency Check for ${{ matrix.name }}
runs-on: ubuntu-20.04
timeout-minutes: 45
strategy:
@@ -55,6 +57,11 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+ with:
+ token: ${{ secrets.GE_ACCESS_TOKEN }}
+
- name: Cache local Maven repository
uses: actions/cache@v3
with:
diff --git a/.github/workflows/pulsar-ci-flaky.yaml
b/.github/workflows/pulsar-ci-flaky.yaml
index 35315d07a7b..e201d379d93 100644
--- a/.github/workflows/pulsar-ci-flaky.yaml
+++ b/.github/workflows/pulsar-ci-flaky.yaml
@@ -69,6 +69,8 @@ jobs:
build-and-test:
needs: preconditions
name: Flaky tests suite
+ env:
+ JOB_NAME: Flaky tests suite
runs-on: ubuntu-20.04
timeout-minutes: 100
if: ${{ needs.preconditions.outputs.docs_only != 'true' }}
@@ -79,6 +81,11 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+ with:
+ token: ${{ secrets.GE_ACCESS_TOKEN }}
+
- name: Setup ssh access to build runner VM
# ssh access is enabled for builds in own forks
if: ${{ github.repository != 'apache/pulsar' && github.event_name ==
'pull_request' }}
diff --git a/.github/workflows/pulsar-ci.yaml b/.github/workflows/pulsar-ci.yaml
index 3570bdc8a78..665a1cb5a07 100644
--- a/.github/workflows/pulsar-ci.yaml
+++ b/.github/workflows/pulsar-ci.yaml
@@ -46,7 +46,7 @@ jobs:
docs_only: ${{ steps.check_changes.outputs.docs_only }}
changed_tests: ${{ steps.changes.outputs.tests_files }}
need_owasp: ${{ steps.changes.outputs.need_owasp }}
-
+
steps:
- name: checkout
uses: actions/checkout@v3
@@ -75,6 +75,8 @@ jobs:
build-and-license-check:
needs: preconditions
name: Build and License check
+ env:
+ JOB_NAME: Build and License check
runs-on: ubuntu-20.04
timeout-minutes: 60
if: ${{ needs.preconditions.outputs.docs_only != 'true' }}
@@ -85,6 +87,11 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+ with:
+ token: ${{ secrets.GE_ACCESS_TOKEN }}
+
- name: Setup ssh access to build runner VM
# ssh access is enabled for builds in own forks
if: ${{ github.repository != 'apache/pulsar' && github.event_name ==
'pull_request' }}
@@ -146,6 +153,8 @@ jobs:
unit-tests:
name: CI - Unit - ${{ matrix.name }}
+ env:
+ JOB_NAME: CI - Unit - ${{ matrix.name }}
runs-on: ubuntu-20.04
timeout-minutes: ${{ matrix.timeout || 60 }}
needs: ['preconditions', 'build-and-license-check']
@@ -171,6 +180,7 @@ jobs:
group: PROXY
- name: Pulsar IO
group: PULSAR_IO
+ timeout: 75
- name: Pulsar Client
group: CLIENT
@@ -181,6 +191,11 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+ with:
+ token: ${{ secrets.GE_ACCESS_TOKEN }}
+
- name: Setup ssh access to build runner VM
# ssh access is enabled for builds in own forks
if: ${{ github.repository != 'apache/pulsar' && github.event_name ==
'pull_request' }}
@@ -283,6 +298,11 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+ with:
+ token: ${{ secrets.GE_ACCESS_TOKEN }}
+
- name: Setup ssh access to build runner VM
# ssh access is enabled for builds in own forks
if: ${{ github.repository != 'apache/pulsar' && github.event_name ==
'pull_request' }}
@@ -341,6 +361,7 @@ jobs:
needs: ['preconditions', 'pulsar-java-test-image']
if: ${{ needs.preconditions.outputs.docs_only != 'true' }}
env:
+ JOB_NAME: CI - Integration - ${{ matrix.name }}
PULSAR_TEST_IMAGE_NAME: apachepulsar/java-test-image:latest
strategy:
fail-fast: false
@@ -382,6 +403,11 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+ with:
+ token: ${{ secrets.GE_ACCESS_TOKEN }}
+
- name: Setup ssh access to build runner VM
# ssh access is enabled for builds in own forks
if: ${{ github.repository != 'apache/pulsar' && github.event_name ==
'pull_request' }}
@@ -490,6 +516,11 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+ with:
+ token: ${{ secrets.GE_ACCESS_TOKEN }}
+
- name: Install gh-actions-artifact-client.js
uses: apache/pulsar-test-infra/gh-actions-artifact-client/dist@master
@@ -512,6 +543,11 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+ with:
+ token: ${{ secrets.GE_ACCESS_TOKEN }}
+
- name: Setup ssh access to build runner VM
# ssh access is enabled for builds in own forks
if: ${{ github.repository != 'apache/pulsar' && github.event_name ==
'pull_request' }}
@@ -603,6 +639,7 @@ jobs:
needs: ['preconditions', 'pulsar-test-latest-version-image']
if: ${{ needs.preconditions.outputs.docs_only != 'true' }}
env:
+ JOB_NAME: CI - System - ${{ matrix.name }}
PULSAR_TEST_IMAGE_NAME: apachepulsar/pulsar-test-latest-version:latest
strategy:
fail-fast: false
@@ -639,6 +676,11 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+ with:
+ token: ${{ secrets.GE_ACCESS_TOKEN }}
+
- name: Setup ssh access to build runner VM
# ssh access is enabled for builds in own forks
if: ${{ github.repository != 'apache/pulsar' && github.event_name ==
'pull_request' }}
@@ -732,6 +774,7 @@ jobs:
needs: [ 'preconditions', 'pulsar-test-latest-version-image' ]
if: ${{ needs.preconditions.outputs.docs_only != 'true' }}
env:
+ JOB_NAME: CI Flaky - System - ${{ matrix.name }}
PULSAR_TEST_IMAGE_NAME: apachepulsar/pulsar-test-latest-version:latest
strategy:
fail-fast: false
@@ -751,6 +794,11 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+ with:
+ token: ${{ secrets.GE_ACCESS_TOKEN }}
+
- name: Setup ssh access to build runner VM
# ssh access is enabled for builds in own forks
if: ${{ github.repository != 'apache/pulsar' && github.event_name ==
'pull_request' }}
@@ -854,6 +902,11 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+ with:
+ token: ${{ secrets.GE_ACCESS_TOKEN }}
+
- name: Install gh-actions-artifact-client.js
uses: apache/pulsar-test-infra/gh-actions-artifact-client/dist@master
@@ -874,6 +927,11 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+ with:
+ token: ${{ secrets.GE_ACCESS_TOKEN }}
+
- name: Cache Maven dependencies
uses: actions/cache@v3
with:
@@ -906,6 +964,11 @@ jobs:
- name: Tune Runner VM
uses: ./.github/actions/tune-runner-vm
+ - name: Configure Gradle Enterprise
+ uses: ./.github/actions/gradle-enterprise
+ with:
+ token: ${{ secrets.GE_ACCESS_TOKEN }}
+
- name: Setup ssh access to build runner VM
# ssh access is enabled for builds in own forks
if: ${{ github.repository != 'apache/pulsar' && github.event_name ==
'pull_request' }}
diff --git a/.gitignore b/.gitignore
index 2759cf054f5..c584baaa0a0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -92,3 +92,9 @@ examples/flink/src/main/java/org/apache/flink/avro/generated
pulsar-flink/src/test/java/org/apache/flink/avro/generated
pulsar-client/src/test/java/org/apache/pulsar/client/avro/generated
/build/
+
+test-reports/
+
+# Gradle Enterprise
+.mvn/.gradle-enterprise/
+.mvn/extensions.xml
diff --git a/.mvn/ge-extensions.xml b/.mvn/ge-extensions.xml
new file mode 100644
index 00000000000..5852f0f5bae
--- /dev/null
+++ b/.mvn/ge-extensions.xml
@@ -0,0 +1,34 @@
+<?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.
+
+-->
+<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0
http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
+ <extension>
+ <groupId>com.gradle</groupId>
+ <artifactId>gradle-enterprise-maven-extension</artifactId>
+ <version>1.16.1</version>
+ </extension>
+ <extension>
+ <groupId>com.gradle</groupId>
+ <artifactId>common-custom-user-data-maven-extension</artifactId>
+ <version>1.11.1</version>
+ </extension>
+</extensions>
diff --git a/.mvn/gradle-enterprise-custom-user-data.groovy
b/.mvn/gradle-enterprise-custom-user-data.groovy
new file mode 100644
index 00000000000..becb3b0149e
--- /dev/null
+++ b/.mvn/gradle-enterprise-custom-user-data.groovy
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+
+// Add Maven command line arguments
+def mavenCommand = ''
+if (System.env.MAVEN_CMD_LINE_ARGS) {
+ mavenCommand = "mvn ${System.env.MAVEN_CMD_LINE_ARGS}".toString()
+ buildScan.value('Maven command line', mavenCommand)
+}
+if (System.env.GITHUB_ACTIONS) {
+ if (session.goals.size() == 1 && session.goals[0] == 'initialize') {
+ // omit publishing build scan when the only goal is "initialize"
+ buildScan.publishOnDemand()
+ } else {
+ def jobName = System.env.JOB_NAME ?: System.env.GITHUB_JOB
+ buildScan.value('GitHub Actions Job name', jobName)
+ buildScan.value('GitHub Actions Event name',
System.env.GITHUB_EVENT_NAME)
+ buildScan.value('GitHub Ref name', System.env.GITHUB_REF_NAME)
+ buildScan.value('GitHub Actor', System.env.GITHUB_ACTOR)
+ buildScan.link('GitHub Repository', "https://github.com/" +
System.env.GITHUB_REPOSITORY)
+ buildScan.link('GitHub Commit', "https://github.com/" +
System.env.GITHUB_REPOSITORY + "/commits/" + System.env.GITHUB_SHA)
+ buildScan.buildScanPublished { publishedBuildScan ->
+ new File(System.env.GITHUB_STEP_SUMMARY).withWriterAppend { out ->
+ out.println("\n[Gradle build scan for '${mavenCommand}' in
${jobName}](${publishedBuildScan.buildScanUri})\n")
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/.mvn/gradle-enterprise.xml b/.mvn/gradle-enterprise.xml
new file mode 100644
index 00000000000..3321acacbd1
--- /dev/null
+++ b/.mvn/gradle-enterprise.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<!--
+
+ 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.
+
+-->
+<gradleEnterprise
+ xmlns="https://www.gradle.com/gradle-enterprise-maven"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="https://www.gradle.com/gradle-enterprise-maven
https://www.gradle.com/schema/gradle-enterprise-maven.xsd">
+ <server>
+ <url>https://ge.apache.org</url>
+ <allowUntrusted>false</allowUntrusted>
+ </server>
+ <buildScan>
+ <captureGoalInputFiles>true</captureGoalInputFiles>
+ <capture>
+ <buildLogging>true</buildLogging>
+ <testLogging>true</testLogging>
+ </capture>
+
<backgroundBuildScanUpload>#{isFalse(env['GITHUB_ACTIONS'])}</backgroundBuildScanUpload>
+ <publish>ALWAYS</publish>
+ <publishIfAuthenticated>true</publishIfAuthenticated>
+ <obfuscation>
+ <ipAddresses>#{{'0.0.0.0'}}</ipAddresses>
+ </obfuscation>
+ </buildScan>
+ <buildCache>
+ <local>
+ <enabled>true</enabled>
+ </local>
+ </buildCache>
+</gradleEnterprise>
diff --git
a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleSchemaTest.java
b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleSchemaTest.java
index 21d6a7ed89a..0a728d98396 100644
---
a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleSchemaTest.java
+++
b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleSchemaTest.java
@@ -65,7 +65,6 @@ import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
-import org.testng.annotations.Factory;
import org.testng.annotations.Test;
@Test(groups = "broker-api")
@@ -93,14 +92,6 @@ public class SimpleSchemaTest extends ProducerConsumerBase {
}
- @DataProvider(name = "schemaValidationModes")
- public static Object[][] schemaValidationModes() {
- return new Object[][] {
- { true },
- { false }
- };
- }
-
@DataProvider(name = "topicDomain")
public static Object[] topicDomain() {
return new Object[] { "persistent://", "non-persistent://" };
@@ -108,8 +99,11 @@ public class SimpleSchemaTest extends ProducerConsumerBase {
private final boolean schemaValidationEnforced;
- @Factory(dataProvider = "schemaValidationModes")
- public SimpleSchemaTest(boolean schemaValidationEnforced) {
+ public SimpleSchemaTest() {
+ this(false);
+ }
+
+ protected SimpleSchemaTest(boolean schemaValidationEnforced) {
this.schemaValidationEnforced = schemaValidationEnforced;
}
diff --git
a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleSchemaWithSchemaValidationEnforcedTest.java
b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleSchemaWithSchemaValidationEnforcedTest.java
new file mode 100644
index 00000000000..0b3527e0b8e
--- /dev/null
+++
b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleSchemaWithSchemaValidationEnforcedTest.java
@@ -0,0 +1,28 @@
+/*
+ * 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.pulsar.client.api;
+
+import org.testng.annotations.Test;
+
+@Test(groups = "broker-api")
+public class SimpleSchemaWithSchemaValidationEnforcedTest extends
SimpleSchemaTest {
+ public SimpleSchemaWithSchemaValidationEnforcedTest() {
+ super(true);
+ }
+}