Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test #2

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
190 changes: 190 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
name: Build and Test

on:
workflow_run:
workflows: ["PR Comment"]
types:
- completed
push: null
pull_request: null

env:
FORK_COUNT: 2
FAIL_FAST: 0
SHOW_ERROR_DETAIL: 1
#multi-version size limit
VERSIONS_LIMIT: 4
CANDIDATE_VERSIONS: '
spring.version:4.3.30.RELEASE;
spring-boot.version:1.5.22.RELEASE;
spring-boot.version:2.4.1;
'
jobs:
build-source:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- uses: actions/cache@v2
name: "Cache local Maven repository"
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- name: "Dubbo cache"
uses: actions/cache@v2
with:
path: ~/.m2/repository/org/apache/dubbo
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}
- name: "Build with Maven"
run: ./mvnw --batch-mode -U -e --no-transfer-progress clean install -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -Dmaven.test.skip=true -Dmaven.test.skip.exec=true
- name: "Calculate Dubbo Version"
run: |
REVISION=`awk '/<revision>[^<]+<\/revision>/{gsub(/<revision>|<\/revision>/,"",$1);print $1;exit;}' pom.xml`
mkdir dubbo-version
echo $REVISION > dubbo-version/dubbo-version
- name: "Upload Dubbo version"
uses: actions/upload-artifact@v2
with:
name: dubbo-version
path: dubbo-version

unit-test:
needs: [build-source]
name: "Unit Test On ${{ matrix.os }} (JDK: ${{ matrix.jdk }})"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-18.04, windows-2019 ]
jdk: [ 8, 11 ]
steps:
- uses: actions/checkout@v2
- name: "Set up JDK ${{ matrix.jdk }}"
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.jdk }}
- uses: actions/cache@v2
name: "Cache local Maven repository"
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Test with Maven with Integration Tests"
timeout-minutes: 30
if: ${{ startsWith( matrix.os, 'ubuntu') }}
run: ./mvnw --batch-mode -U -e --no-transfer-progress clean test -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=5 -DskipTests=false -DskipIntegrationTests=false -Dcheckstyle.skip=false -Drat.skip=false -Dmaven.javadoc.skip=true
- name: "Test with Maven without Integration Tests"
env:
DISABLE_FILE_SYSTEM_TEST: true
timeout-minutes: 30
if: ${{ startsWith( matrix.os, 'windows') }}
run: ./mvnw --batch-mode -U -e --no-transfer-progress clean install -D"http.keepAlive=false" -D"maven.wagon.http.pool=false" -D"maven.wagon.httpconnectionManager.ttlSeconds=120" -D"maven.wagon.http.retryHandler.count=5" -DskipTests=false -DskipIntegrationTests=true -D"checkstyle.skip=false" -D"rat.skip=false" -D"maven.javadoc.skip=true"
- name: Publish Test Report
uses: scacap/action-surefire-report@v1
if: ${{ always() }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v1

integration-test-prepare:
runs-on: ubuntu-18.04
env:
JOB_COUNT: 3
steps:
- uses: actions/checkout@v2
with:
repository: 'apache/dubbo-samples'
ref: master
- name: "Prepare test list"
run: |
bash ./test/scripts/prepare-test.sh
- name: "Upload test list"
uses: actions/upload-artifact@v2
with:
name: test-list
path: test/jobs

integration-test-job:
needs: [build-source, integration-test-prepare]
name: "Integration Test on ubuntu-18.04 (JobId: ${{matrix.job_id}})"
runs-on: ubuntu-18.04
timeout-minutes: 30
env:
JAVA_VER: 8
TEST_CASE_FILE: jobs/testjob_${{matrix.job_id}}.txt
strategy:
fail-fast: false
matrix:
job_id: [1, 2, 3]
steps:
- uses: actions/checkout@v2
with:
repository: 'apache/dubbo-samples'
ref: master
- name: "Cache local Maven repository"
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: "Restore Dubbo cache"
uses: actions/cache@v2
with:
path: ~/.m2/repository/org/apache/dubbo
key: ${{ runner.os }}-dubbo-snapshot-${{ github.sha }}
restore-keys: |
${{ runner.os }}-dubbo-
- name: "Download test list"
uses: actions/download-artifact@v2
with:
name: test-list
path: test/jobs/
- name: "Download Dubbo version"
uses: actions/download-artifact@v2
with:
name: dubbo-version
path: dubbo-version
- name: "Set up JDK 8"
uses: actions/setup-java@v1
with:
java-version: 8
- name: "Init Candidate Versions"
run: |
DUBBO_VERSION=`cat dubbo-version/dubbo-version`
CANDIDATE_VERSIONS="dubbo.version:$DUBBO_VERSION;$CANDIDATE_VERSIONS"
echo "CANDIDATE_VERSIONS=$CANDIDATE_VERSIONS" >> $GITHUB_ENV
- name: "Build test image"
run: |
cd test && bash ./build-test-image.sh
- name: "Run tests"
run: cd test && bash ./run-tests.sh
- name: "Upload test result"
if: always()
uses: actions/upload-artifact@v2
with:
name: test-result
path: test/jobs/*-result*

integration-test-result:
needs: [integration-test-job]
if: always()
runs-on: ubuntu-18.04
env:
JAVA_VER: 8
steps:
- uses: actions/checkout@v2
with:
repository: 'apache/dubbo-samples'
ref: master
- name: "Download test result"
uses: actions/download-artifact@v2
with:
name: test-result
path: test/jobs/
- name: "Merge test result"
run: ./test/scripts/merge-test-results.sh
13 changes: 13 additions & 0 deletions .github/workflows/pr-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: PR Comment

on: [pull_request_review_comment]

jobs:
check-comment:
runs-on: ubuntu-latest
if: ${{ !startsWith( github.event.comment.body, 'Retrigger test workflow' ) }}
steps:
- uses: potiuk/cancel-workflow-runs@master
with:
cancelMode: self
token: ${{ secrets.GITHUB_TOKEN }}
67 changes: 0 additions & 67 deletions .github/workflows/unit-test.yml

This file was deleted.

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ The following code snippet comes from [Dubbo Samples](https://github.com/apache/
# cd dubbo-samples/java/dubbo-samples-api
```

There's a [README](https://github.com/apache/dubbo-samples/tree/master/dubbo-samples-api/README.md) file under `dubbo-samples-api` directory. We recommend referencing the samples in that directory by following the below-mentioned instructions:
There's a [README](https://github.com/apache/dubbo-samples/tree/master/dubbo-samples-api/README.md) file under `dubbo-samples-api` directory. We recommend referencing the samples in that directory by following the below-mentioned instructions:

### Maven dependency

```xml
<properties>
<dubbo.version>2.7.8</dubbo.version>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.dubbo</groupId>
Expand Down Expand Up @@ -182,11 +182,11 @@ If you want to try out the cutting-edge features, you can build with the followi

## Contact

* Mailing list:
* Mailing list:
* dev list: for dev/user discussion. [subscribe](mailto:[email protected]), [unsubscribe](mailto:[email protected]), [archive](https://lists.apache.org/[email protected]), [guide](https://github.com/apache/dubbo/wiki/Mailing-list-subscription-guide)

* Bugs: [Issues](https://github.com/apache/dubbo/issues/new?template=dubbo-issue-report-template.md)
* Gitter: [Gitter channel](https://gitter.im/alibaba/dubbo)
* Gitter: [Gitter channel](https://gitter.im/alibaba/dubbo)
* Twitter: [@ApacheDubbo](https://twitter.com/ApacheDubbo)

## Contributing
Expand Down Expand Up @@ -228,10 +228,10 @@ Please report security vulnerabilities to [us](mailto:[email protected])

#### Language

* [Go](https://github.com/dubbo/dubbo-go) (recommended)
* [Node.js](https://github.com/apache/dubbo-js)
* [Python](https://github.com/dubbo/py-client-for-apache-dubbo)
* [PHP](https://github.com/apache/dubbo-php-framework)
* [Go](https://github.com/dubbo/dubbo-go)
* [Erlang](https://github.com/apache/dubbo-erlang)

## License
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public String toString() {

@Override
protected Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
// The only purpose is to build a interceptor chain, so the cluster related logic doesn't matter.
// The only purpose is to build an interceptor chain, so the cluster related logic doesn't matter.
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* 2019-10-10
*/
public class BaseServiceMetadata {
public static final char COLON_SEPERATOR = ':';
public static final char COLON_SEPARATOR = ':';

protected String serviceKey;
protected String serviceInterfaceName;
Expand Down Expand Up @@ -73,7 +73,7 @@ public static String interfaceFromServiceKey(String serviceKey) {
public String getDisplayServiceKey() {
StringBuilder serviceNameBuilder = new StringBuilder();
serviceNameBuilder.append(serviceInterfaceName);
serviceNameBuilder.append(COLON_SEPERATOR).append(version);
serviceNameBuilder.append(COLON_SEPARATOR).append(version);
return serviceNameBuilder.toString();
}

Expand All @@ -84,7 +84,7 @@ public String getDisplayServiceKey() {
* @return
*/
public static BaseServiceMetadata revertDisplayServiceKey(String displayKey) {
String[] eles = StringUtils.split(displayKey, COLON_SEPERATOR);
String[] eles = StringUtils.split(displayKey, COLON_SEPARATOR);
if (eles == null || eles.length < 1 || eles.length > 2) {
return new BaseServiceMetadata();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private static URL parseURLBody(String fullURLStr, String decodedBody, Map<Strin
*/
public static URL parseEncodedStr(String encodedURLStr) {
Map<String, String> parameters = null;
int pathEndIdx = encodedURLStr.indexOf("%3F");// '?'
int pathEndIdx = encodedURLStr.toUpperCase().indexOf("%3F");// '?'
if (pathEndIdx >= 0) {
parameters = parseEncodedParams(encodedURLStr, pathEndIdx + 3);
} else {
Expand Down
Loading