Skip to content

Commit

Permalink
Merge branch '3.3' into 1206-ut
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbumenJ authored Dec 6, 2024
2 parents 579b8bf + 3dd9065 commit e8ba536
Show file tree
Hide file tree
Showing 36 changed files with 518 additions and 359 deletions.
92 changes: 61 additions & 31 deletions .github/workflows/build-and-test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ jobs:
steps:
- name: "Checkout code"
uses: actions/checkout@v4
with:
path: dubbo
- name: "Set up JDK"
uses: actions/setup-java@v4
with:
Expand All @@ -135,7 +133,6 @@ jobs:
run: rm -rf ~/.m2/repository/org/apache/dubbo
- name: "Build Dubbo with maven"
run: |
cd ./dubbo
./mvnw ${{ env.MAVEN_ARGS }} clean install -Psources,'!demo',skip-spotless,checkstyle -Dmaven.test.skip=true -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper
- name: "Save dubbo cache"
uses: actions/cache/save@v4
Expand Down Expand Up @@ -171,7 +168,7 @@ jobs:
- name: "Calculate Dubbo Version"
id: dubbo-version
run: |
REVISION=`awk '/<revision>[^<]+<\/revision>/{gsub(/<revision>|<\/revision>/,"",$1);print $1;exit;}' ./dubbo/pom.xml`
REVISION=`awk '/<revision>[^<]+<\/revision>/{gsub(/<revision>|<\/revision>/,"",$1);print $1;exit;}' ./pom.xml`
echo "version=$REVISION" >> $GITHUB_OUTPUT
echo "dubbo version: $REVISION"
Expand Down Expand Up @@ -210,7 +207,7 @@ jobs:
ls -al ${{ github.workspace }}/.tmp/zookeeper/apache-zookeeper-bin.tar.gz
unit-test:
needs: [check-format, build-source, unit-test-prepare]
needs: [check-format, unit-test-prepare]
name: "Unit Test On ubuntu-latest"
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -251,15 +248,23 @@ jobs:
timeout-minutes: 90
run: |
set -o pipefail
./mvnw ${{ env.MAVEN_ARGS }} clean test verify -Pjacoco,jdk15ge-simple,'!jdk15ge','!demo',skip-spotless,jacoco089 -DtrimStackTrace=false -Dmaven.test.skip=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper 2>&1 | tee >(grep -n -B 1 -A 200 "FAILURE! -- in" > test_errors.log)
./mvnw ${{ env.MAVEN_ARGS }} clean test verify -Pjacoco,jdk15ge-simple,'!jdk15ge','!demo',skip-spotless -DtrimStackTrace=false -Dmaven.test.skip=false -Dcheckstyle.skip=false -Dcheckstyle_unix.skip=false -Drat.skip=false -DembeddedZookeeperPath=${{ github.workspace }}/.tmp/zookeeper 2>&1 | tee >(grep -n -B 1 -A 200 "FAILURE! -- in" > test_errors.log)
- name: "Print test error log"
if: failure()
run: cat test_errors.log
- name: "Upload coverage result"
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
flags: unit-tests
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: "Upload surefire reports"
uses: actions/upload-artifact@v4
with:
name: coverage-result
path: "**/target/site/**/jacoco.xml"
name: surefire-reports
path: "**/target/surefire-reports/**"

samples-test-prepare:
needs: check-format
Expand Down Expand Up @@ -467,21 +472,15 @@ jobs:
- name: "Merge test result"
run: ./test/scripts/merge-test-results.sh

jacoco-result-merge:
samples-jacoco-result-merge:
runs-on: ubuntu-latest
needs: [check-format, integration-test-result, samples-test-result, unit-test]
needs: [check-format, samples-test-result]
steps:
- uses: actions/checkout@v4
with:
path: "./dubbo"
- uses: actions/checkout@v4
with:
repository: 'apache/dubbo-samples'
path: "./dubbo-samples"
- uses: actions/checkout@v4
with:
repository: 'apache/dubbo-integration-cases'
path: "./dubbo-integration-cases"
- name: "Set up JDK 21"
uses: actions/setup-java@v4
with:
Expand All @@ -495,39 +494,70 @@ jobs:
path: ${{ github.workspace }}
- name: "Unpack class result"
run: |
cd ${{ github.workspace }}/dubbo
unzip -o ${{ github.workspace }}/class.zip
- name: "Restore samples jacoco exec"
uses: actions/download-artifact@v4
with:
pattern: samples-jacoco-result-*
github-token: ${{ secrets.GITHUB_TOKEN }}
path: dubbo-samples/target/
- name: "Merge samples jacoco result"
run: |
cd ${{ github.workspace }}/dubbo-samples/test/dubbo-test-jacoco-merger
mvn clean compile exec:java -Dexec.mainClass="org.apache.dubbo.test.JacocoReport" -Dexec.args="${{github.workspace}}/dubbo-samples ${{github.workspace}}"
- name: "Remove old test result"
run: |
rm -rf ${{ github.workspace }}/dubbo-samples
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: samples-tests
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

integration-jacoco-result-merge:
runs-on: ubuntu-latest
needs: [check-format, integration-test-result, samples-test-result]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: 'apache/dubbo-integration-cases'
path: "./dubbo-integration-cases"
- name: "Set up JDK 21"
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
- name: "Restore class result"
uses: actions/download-artifact@v4
with:
name: "class-file"
github-token: ${{ secrets.GITHUB_TOKEN }}
path: ${{ github.workspace }}
- name: "Unpack class result"
run: |
unzip -o ${{ github.workspace }}/class.zip
- name: "Restore integration test jacoco exec"
uses: actions/download-artifact@v4
with:
pattern: jacoco-result-*
github-token: ${{ secrets.GITHUB_TOKEN }}
path: dubbo-integration-cases/target/
- name: "Merge samples jacoco result"
run: |
cd ${{ github.workspace }}/dubbo-samples/test/dubbo-test-jacoco-merger
mvn clean compile exec:java -Dexec.mainClass="org.apache.dubbo.test.JacocoReport" -Dexec.args="${{github.workspace}}/dubbo-samples ${{github.workspace}}/dubbo"
- name: "Merge integration test jacoco result"
run: |
cd ${{ github.workspace }}/dubbo-integration-cases/test/dubbo-test-jacoco-merger
mvn clean compile exec:java -Dexec.mainClass="org.apache.dubbo.test.JacocoReport" -Dexec.args="${{github.workspace}}/dubbo-integration-cases ${{github.workspace}}/dubbo"
- name: "Restore coverage result"
uses: actions/download-artifact@v4
with:
name: coverage-result
github-token: ${{ secrets.GITHUB_TOKEN }}
path: dubbo/
mvn clean compile exec:java -Dexec.mainClass="org.apache.dubbo.test.JacocoReport" -Dexec.args="${{github.workspace}}/dubbo-integration-cases ${{github.workspace}}"
- name: "Remove old test result"
run: |
rm -rf ${{ github.workspace }}/dubbo-integration-cases
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
version: v0.6.0
flags: integration-tests
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand Down
3 changes: 3 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ codecov:
require_ci_to_pass: false
notify:
wait_for_ci: false
fixes:
- "/home/runner/work/dubbo/dubbo/::"
- "/home/runner/work/dubbo/dubbo/dubbo/::"
coverage:
status:
# pull-requests only
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,15 @@ public static void beforeAll() {
@BeforeEach
public void setUp() throws Exception {
DubboBootstrap.reset();
FrameworkModel.destroyAll();
ApplicationModel.defaultModel().getApplicationConfigManager();
DubboBootstrap.getInstance();
}

@AfterEach
public void tearDown() throws IOException {
DubboBootstrap.reset();
FrameworkModel.destroyAll();
Mockito.framework().clearInlineMocks();
}

Expand Down
4 changes: 2 additions & 2 deletions dubbo-dependencies-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
<nacos_version>2.4.3</nacos_version>
<sentinel.version>1.8.8</sentinel.version>
<seata.version>1.8.0</seata.version>
<grpc.version>1.68.0</grpc.version>
<grpc.version>1.68.2</grpc.version>
<grpc_contrib_verdion>0.8.1</grpc_contrib_verdion>
<jprotoc_version>1.2.2</jprotoc_version>
<mustache_version>0.9.14</mustache_version>
Expand Down Expand Up @@ -173,7 +173,7 @@
<bouncycastle-bcprov_version>1.70</bouncycastle-bcprov_version>
<metrics_version>2.0.6</metrics_version>
<gson_version>2.11.0</gson_version>
<jackson_version>2.18.1</jackson_version>
<jackson_version>2.18.2</jackson_version>
<mortbay_jetty_version>6.1.26</mortbay_jetty_version>
<portlet_version>2.0</portlet_version>
<maven_flatten_version>1.6.0</maven_flatten_version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
package org.apache.dubbo.remoting.api.connection;

import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.remoting.ChannelHandler;
import org.apache.dubbo.remoting.RemotingException;
import org.apache.dubbo.remoting.api.WireProtocol;
Expand All @@ -32,9 +30,6 @@

public abstract class AbstractConnectionClient extends AbstractClient {

private static final ErrorTypeAwareLogger logger =
LoggerFactory.getErrorTypeAwareLogger(AbstractConnectionClient.class);

protected WireProtocol protocol;

protected InetSocketAddress remote;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.Version;
import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.threadpool.manager.ExecutorRepository;
import org.apache.dubbo.common.threadpool.manager.FrameworkExecutorRepository;
import org.apache.dubbo.common.utils.NetUtils;
Expand Down Expand Up @@ -55,8 +53,6 @@
*/
public abstract class AbstractClient extends AbstractEndpoint implements Client {

private static final ErrorTypeAwareLogger logger = LoggerFactory.getErrorTypeAwareLogger(AbstractClient.class);

private final Lock connectLock = new ReentrantLock();

private final boolean needReconnect;
Expand Down Expand Up @@ -148,7 +144,7 @@ protected AbstractClient() {
private void initExecutor(URL url) {
ExecutorRepository executorRepository = ExecutorRepository.getInstance(url.getOrDefaultApplicationModel());

/**
/*
* Consumer's executor is shared globally, provider ip doesn't need to be part of the thread name.
*
* Instance of url is InstanceAddressURL, so addParameter actually adds parameters into ServiceInstance,
Expand Down Expand Up @@ -415,36 +411,26 @@ public String toString() {

/**
* Open client.
*
* @throws Throwable
*/
protected abstract void doOpen() throws Throwable;

/**
* Close client.
*
* @throws Throwable
*/
protected abstract void doClose() throws Throwable;

/**
* Connect to server.
*
* @throws Throwable
*/
protected abstract void doConnect() throws Throwable;

/**
* disConnect to server.
*
* @throws Throwable
*/
protected abstract void doDisConnect() throws Throwable;

/**
* Get the connected channel.
*
* @return channel
*/
protected abstract Channel getChannel();
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
public abstract class AbstractEndpoint extends AbstractPeer implements Resetable {

private static final ErrorTypeAwareLogger logger = LoggerFactory.getErrorTypeAwareLogger(AbstractEndpoint.class);
protected final ErrorTypeAwareLogger logger = LoggerFactory.getErrorTypeAwareLogger(getClass());

private Codec2 codec;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
package org.apache.dubbo.remoting.transport;

import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.threadpool.manager.ExecutorRepository;
import org.apache.dubbo.common.utils.ConcurrentHashSet;
import org.apache.dubbo.common.utils.ExecutorUtil;
Expand All @@ -45,7 +43,7 @@
* AbstractServer
*/
public abstract class AbstractServer extends AbstractEndpoint implements RemotingServer {
private static final ErrorTypeAwareLogger logger = LoggerFactory.getErrorTypeAwareLogger(AbstractServer.class);

private Set<ExecutorService> executors = new ConcurrentHashSet<>();
private InetSocketAddress localAddress;
private InetSocketAddress bindAddress;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* 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.dubbo.remoting.http3.netty4;

public final class Constants {

public static final String PIPELINE_CONFIGURATOR_KEY = "http3PipelineConfigurator";
public static final CharSequence TRI_PING = "tri-ping";

private Constants() {}
}
Loading

0 comments on commit e8ba536

Please sign in to comment.