forked from apache/dubbo
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '3.3' into fix/native_enum
- Loading branch information
Showing
49 changed files
with
375 additions
and
2,161 deletions.
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,49 @@ env: | |
' | ||
|
||
jobs: | ||
check-format: | ||
name: Check if code needs formatting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Maven | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 21 | ||
distribution: zulu | ||
- name: Check if code aligns with code style | ||
id: check | ||
run: mvn --log-file mvn.log spotless:check | ||
continue-on-error: true | ||
- name: Upload checkstyle result | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: checkstyle-result | ||
path: mvn.log | ||
- name: Generate Summary for successful run | ||
if: ${{ steps.check.outcome == 'success' }} | ||
run: | | ||
echo ":ballot_box_with_check: Kudos! No formatting issues found!" >> $GITHUB_STEP_SUMMARY | ||
- name: Generate Summary for failed run | ||
if: ${{ steps.check.outcome == 'failure' }} | ||
run: | | ||
echo "## :negative_squared_cross_mark: Formatting issues found!" >> $GITHUB_STEP_SUMMARY | ||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | ||
cat mvn.log | grep "ERROR" | sed 's/Check if code needs formatting Check if code aligns with code style [0-9A-Z:.-]\+//' | sed 's/\[ERROR] //' | head -n -11 >> $GITHUB_STEP_SUMMARY | ||
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY | ||
echo "Please run \`mvn spotless:apply\` to fix the formatting issues." >> $GITHUB_STEP_SUMMARY | ||
- name: Fail if code needs formatting | ||
if: ${{ steps.check.outcome == 'failure' }} | ||
uses: actions/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
core.setFailed("Formatting issues found!") | ||
license: | ||
name: "Check License" | ||
needs: check-format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
@@ -43,6 +85,8 @@ jobs: | |
mode: check | ||
|
||
build-source: | ||
name: "Build Dubbo" | ||
needs: check-format | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.dubbo-version.outputs.version }} | ||
|
@@ -98,6 +142,7 @@ jobs: | |
unit-test-prepare: | ||
name: "Preparation for Unit Test" | ||
needs: check-format | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
|
@@ -146,7 +191,7 @@ jobs: | |
echo "--- End Print Rsa Public Key" | ||
unit-test: | ||
needs: [build-source, unit-test-prepare] | ||
needs: [check-format, build-source, unit-test-prepare] | ||
name: "Unit Test On ubuntu-latest" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
|
@@ -212,6 +257,7 @@ jobs: | |
path: "**/target/site/**/jacoco.xml" | ||
|
||
samples-test-prepare: | ||
needs: check-format | ||
runs-on: ubuntu-latest | ||
env: | ||
JOB_COUNT: 3 | ||
|
@@ -229,7 +275,7 @@ jobs: | |
name: samples-test-list | ||
path: test/jobs | ||
samples-test-job: | ||
needs: [build-source, samples-test-prepare] | ||
needs: [check-format, build-source, samples-test-prepare] | ||
name: "Samples Test on ubuntu-latest (JobId: ${{matrix.job_id}})" | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 90 | ||
|
@@ -296,7 +342,7 @@ jobs: | |
name: samples-test-result | ||
path: test/jobs/*-result* | ||
samples-test-result: | ||
needs: [samples-test-job] | ||
needs: [check-format, samples-test-job] | ||
if: always() | ||
runs-on: ubuntu-latest | ||
env: | ||
|
@@ -315,6 +361,7 @@ jobs: | |
run: ./test/scripts/merge-test-results.sh | ||
|
||
integration-test-prepare: | ||
needs: check-format | ||
runs-on: ubuntu-latest | ||
env: | ||
JOB_COUNT: 3 | ||
|
@@ -332,7 +379,7 @@ jobs: | |
name: test-list | ||
path: test/jobs | ||
integration-test-job: | ||
needs: [build-source, integration-test-prepare] | ||
needs: [check-format, build-source, integration-test-prepare] | ||
name: "Integration Test on ubuntu-latest (JobId: ${{matrix.job_id}})" | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 90 | ||
|
@@ -399,7 +446,7 @@ jobs: | |
name: test-result | ||
path: test/jobs/*-result* | ||
integration-test-result: | ||
needs: [integration-test-job] | ||
needs: [check-format, integration-test-job] | ||
if: always() | ||
runs-on: ubuntu-latest | ||
env: | ||
|
@@ -419,7 +466,7 @@ jobs: | |
|
||
jacoco-result-merge: | ||
runs-on: ubuntu-latest | ||
needs: [integration-test-result, samples-test-result, unit-test] | ||
needs: [check-format, integration-test-result, samples-test-result, unit-test] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
|
@@ -475,6 +522,7 @@ jobs: | |
verbose: true | ||
|
||
error-code-inspecting: | ||
needs: check-format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
@@ -513,6 +561,7 @@ jobs: | |
path: ${{ github.workspace }}/dubbo-test-tools/dubbo-error-code-inspector/error-inspection-result.txt | ||
|
||
native-image-inspecting: | ||
needs: check-format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
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 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 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,8 +38,11 @@ class URLStrParserTest { | |
testCases.add("dubbo://192.168.1.1"); | ||
testCases.add("dubbo://192.168.1.1?"); | ||
testCases.add("dubbo://127.0.0.1?test=中文测试"); | ||
testCases.add( | ||
"dubbo://admin:[email protected]:28113/org.test.api.DemoService$Iface?anyhost=true&application=demo-service&dubbo=2.6.1&generic=false&interface=org.test.api.DemoService$Iface&methods=orbCompare,checkText,checkPicture&pid=65557&revision=1.4.17&service.filter=bootMetrics&side=provider&status=server&threads=200×tamp=1583136298859&version=1.0.0"); | ||
testCases.add("dubbo://admin:[email protected]:28113/org.test.api" | ||
+ ".DemoService$Iface?anyhost=true&application=demo-service&dubbo=2.6.1&generic=false&interface=org" | ||
+ ".test.api.DemoService$Iface&methods=orbCompare,checkText,checkPicture&pid=65557&revision=1.4" | ||
+ ".17&service.filter=bootMetrics&side=provider&status=server&threads=200×tamp=1583136298859" | ||
+ "&version=1.0.0"); | ||
// super long text test | ||
testCases.add("dubbo://192.168.1.1/" + RandomString.make(10240)); | ||
testCases.add("file:/path/to/file.txt"); | ||
|
@@ -57,8 +60,8 @@ class URLStrParserTest { | |
errorEncodedCases.add("dubbo%3a192.168.1.1%3fabc%3dabc"); | ||
errorEncodedCases.add("%3a%2f%2f192.168.1.1%3fabc%3dabc"); | ||
errorEncodedCases.add("%3a%2f192.168.1.1%3fabc%3dabc"); | ||
errorEncodedCases.add( | ||
"dubbo%3a%2f%2f127.0.0.1%3ftest%3d%e2%96%b2%e2%96%bc%e2%97%80%e2%96%b6%e2%86%90%e2%86%91%e2%86%92%e2%86%93%e2%86%94%e2%86%95%e2%88%9e%c2%b1%e9%be%98%e9%9d%90%e9%bd%89%9%d%b"); | ||
errorEncodedCases.add("dubbo%3a%2f%2f127.0.0.1%3ftest%3d%e2%96%b2%e2%96%bc%e2%97%80%e2%96%b6%e2%86%90%e2%86" | ||
+ "%91%e2%86%92%e2%86%93%e2%86%94%e2%86%95%e2%88%9e%c2%b1%e9%be%98%e9%9d%90%e9%bd%89%9%d%b"); | ||
} | ||
|
||
@Test | ||
|
@@ -93,4 +96,17 @@ void testDefault() { | |
assertThat(url2.getParameter("timeout"), equalTo("5678")); | ||
assertThat(url2.getParameter("default.timeout"), equalTo("5678")); | ||
} | ||
|
||
@Test | ||
void testPond() { | ||
String str = "https://a#@b"; | ||
|
||
URL url1 = URL.valueOf(str); | ||
URL url2 = URLStrParser.parseDecodedStr(str); | ||
|
||
Assertions.assertEquals("https", url1.getProtocol()); | ||
Assertions.assertEquals("https", url2.getProtocol()); | ||
Assertions.assertEquals("a", url1.getHost()); | ||
Assertions.assertEquals("a", url2.getHost()); | ||
} | ||
} |
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
Oops, something went wrong.