You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "AsterZephyr (via GitHub)" <gi...@apache.org> on 2025/01/14 17:57:35 UTC
[PR] the ability to automatically run unit tests after creating a pull request. [incubator-seata-go]
AsterZephyr opened a new pull request, #764:
URL: https://github.com/apache/incubator-seata-go/pull/764
<!-- Thanks for sending a pull request!
-->
**What this PR does**:
1. Add unit test workflow to automatically run tests on PR
2. Separate unit tests from integration tests
3. Add coverage report upload to codecov
4. Fix buildAfterImageSQL return value issue in mysql_insertonduplicate_update_undo_log_builder_test.go
**Which issue(s) this PR fixes**:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
-->
Fixes #762
**Special notes for your reviewer**:
1. Added new workflow file `.github/workflows/unit-test.yml`
2. Kept integration tests in original workflow
3. Added timeout settings and better error reporting
```release-note
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] the ability to automatically run unit tests after creating a pull request. [incubator-seata-go]
Posted by "Code-Fight (via GitHub)" <gi...@apache.org>.
Code-Fight merged PR #764:
URL: https://github.com/apache/incubator-seata-go/pull/764
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] the ability to automatically run unit tests after creating a pull request. [incubator-seata-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #764:
URL: https://github.com/apache/incubator-seata-go/pull/764#issuecomment-2590728991
## [](https://sonarcloud.io/dashboard?id=apache_incubator-seata-go&pullRequest=764) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_incubator-seata-go&pullRequest=764&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_incubator-seata-go&pullRequest=764&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-seata-go&pullRequest=764&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-seata-go&pullRequest=764&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-seata-go&pullRequest=764&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_incubator-seata-go&pullRequest=764)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] the ability to automatically run unit tests after creating a pull request. [incubator-seata-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #764:
URL: https://github.com/apache/incubator-seata-go/pull/764#issuecomment-2599792642
## [](https://sonarcloud.io/dashboard?id=apache_incubator-seata-go&pullRequest=764) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_incubator-seata-go&pullRequest=764&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_incubator-seata-go&pullRequest=764&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-seata-go&pullRequest=764&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-seata-go&pullRequest=764&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-seata-go&pullRequest=764&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_incubator-seata-go&pullRequest=764)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] the ability to automatically run unit tests after creating a pull request. [incubator-seata-go]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #764:
URL: https://github.com/apache/incubator-seata-go/pull/764#discussion_r2094677296
##########
.github/workflows/unit-test.yml:
##########
@@ -0,0 +1,78 @@
+#
+# 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: "Unit Test"
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ "*" ]
+ types: [opened, synchronize, reopened]
+
+permissions:
+ contents: read
+
+jobs:
+ unit-test:
+ name: Unit Test
+ runs-on: ubuntu-latest
+ timeout-minutes: 10
+ strategy:
+ matrix:
+ golang:
+ - 1.18
+
+ steps:
+ - name: "Set up Go"
+ uses: actions/setup-go@v3
+ with:
+ go-version: ${{ matrix.golang }}
+
+ - name: "Checkout code"
+ uses: actions/checkout@v3
+ with:
+ submodules: true
+
+ - name: "Cache dependencies"
+ uses: actions/cache@v3
+ with:
+ path: ~/go/pkg/mod
+ key: "${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}"
+ restore-keys: |
+ "${{ runner.os }}-go-"
+
+ - name: Shutdown default mysql
+ run: sudo service mysql stop
+
+
+ - name: "Run Unit Tests"
+ run: |
+ echo "=== Starting Unit Tests ==="
+ go test -v ./... -race -coverprofile=coverage.txt -covermode=atomic -timeout 10m
+ if [ $? -ne 0 ]; then
+ echo "❌ Unit tests failed"
+ exit 1
+ fi
+ echo "✅ Unit tests completed successfully"
+
+ - name: "Archive test results"
Review Comment:
The PR description mentions uploading coverage to Codecov, but there’s no `codecov/codecov-action` step in this workflow. Add a step after archiving to upload `coverage.txt` to Codecov.
##########
.github/workflows/unit-test.yml:
##########
@@ -0,0 +1,78 @@
+#
+# 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: "Unit Test"
+
+on:
+ push:
+ branches: [ master ]
+ pull_request:
+ branches: [ "*" ]
+ types: [opened, synchronize, reopened]
+
+permissions:
+ contents: read
+
+jobs:
+ unit-test:
+ name: Unit Test
+ runs-on: ubuntu-latest
+ timeout-minutes: 10
+ strategy:
+ matrix:
+ golang:
+ - 1.18
+
+ steps:
+ - name: "Set up Go"
+ uses: actions/setup-go@v3
+ with:
+ go-version: ${{ matrix.golang }}
+
+ - name: "Checkout code"
+ uses: actions/checkout@v3
+ with:
+ submodules: true
+
+ - name: "Cache dependencies"
+ uses: actions/cache@v3
+ with:
+ path: ~/go/pkg/mod
+ key: "${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}"
+ restore-keys: |
+ "${{ runner.os }}-go-"
+
+ - name: Shutdown default mysql
+ run: sudo service mysql stop
+
+
+ - name: "Run Unit Tests"
+ run: |
+ echo "=== Starting Unit Tests ==="
+ go test -v ./... -race -coverprofile=coverage.txt -covermode=atomic -timeout 10m
+ if [ $? -ne 0 ]; then
+ echo "❌ Unit tests failed"
+ exit 1
+ fi
+ echo "✅ Unit tests completed successfully"
Review Comment:
[nitpick] This explicit exit check is redundant—GitHub Actions will fail on a non-zero exit by default. Consider simplifying by running `go test ...` directly.
```suggestion
go test -v ./... -race -coverprofile=coverage.txt -covermode=atomic -timeout 10m && echo "✅ Unit tests completed successfully"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] the ability to automatically run unit tests after creating a pull request. [incubator-seata-go]
Posted by "luky116 (via GitHub)" <gi...@apache.org>.
luky116 commented on PR #764:
URL: https://github.com/apache/incubator-seata-go/pull/764#issuecomment-2599686767
看下 CI 问题
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] the ability to automatically run unit tests after creating a pull request. [incubator-seata-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #764:
URL: https://github.com/apache/incubator-seata-go/pull/764#issuecomment-2599799953
## [](https://sonarcloud.io/dashboard?id=apache_incubator-seata-go&pullRequest=764) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_incubator-seata-go&pullRequest=764&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_incubator-seata-go&pullRequest=764&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-seata-go&pullRequest=764&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-seata-go&pullRequest=764&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-seata-go&pullRequest=764&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_incubator-seata-go&pullRequest=764)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] the ability to automatically run unit tests after creating a pull request. [incubator-seata-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #764:
URL: https://github.com/apache/incubator-seata-go/pull/764#issuecomment-2660874810
## [](https://sonarcloud.io/dashboard?id=apache_incubator-seata-go&pullRequest=764) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_incubator-seata-go&pullRequest=764&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_incubator-seata-go&pullRequest=764&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-seata-go&pullRequest=764&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-seata-go&pullRequest=764&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-seata-go&pullRequest=764&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_incubator-seata-go&pullRequest=764)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] the ability to automatically run unit tests after creating a pull request. [incubator-seata-go]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #764:
URL: https://github.com/apache/incubator-seata-go/pull/764#issuecomment-2611495590
## [](https://sonarcloud.io/dashboard?id=apache_incubator-seata-go&pullRequest=764) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_incubator-seata-go&pullRequest=764&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_incubator-seata-go&pullRequest=764&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_incubator-seata-go&pullRequest=764&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-seata-go&pullRequest=764&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_incubator-seata-go&pullRequest=764&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_incubator-seata-go&pullRequest=764)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org