feat:Add GitHub action of codecov.yml. (#328)

pull/333/head
Haotian Zhang 2 years ago committed by GitHub
parent ff94e2ed46
commit 5acefc5d9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,32 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Codecov
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout codes
uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 8
- name: Test with Maven
run: mvn -B test --file pom.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ${{ github.workspace }}/target/site/jacoco/jacoco.xml

@ -41,11 +41,5 @@ jobs:
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# - name: Build with Maven
# run: mvn -B package --file pom.xml
- name: Test with Maven
run: mvn -B test --file pom.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: '**/target/site/jacoco/jacoco.xml'

@ -21,3 +21,4 @@
- [Fix the current limiting effect is that other requests cannot be processed when queuing at a constant speed](https://github.com/Tencent/spring-cloud-tencent/pull/316)
- [Fix config file format misspell](https://github.com/Tencent/spring-cloud-tencent/pull/319)
- [UT: improve test coverage for load balancer unit test](https://github.com/Tencent/spring-cloud-tencent/pull/325)
- [feat:Add GitHub action of codecov.yml.](https://github.com/Tencent/spring-cloud-tencent/pull/328)

@ -61,7 +61,7 @@ public class PolarisDiscoveryHandler {
GetHealthyInstancesRequest getHealthyInstancesRequest = new GetHealthyInstancesRequest();
getHealthyInstancesRequest.setNamespace(namespace);
getHealthyInstancesRequest.setService(service);
return polarisConsumer.getHealthyInstancesInstance(getHealthyInstancesRequest);
return polarisConsumer.getHealthyInstances(getHealthyInstancesRequest);
}
/**

@ -71,7 +71,7 @@
<properties>
<revision>1.6.0-Hoxton.SR12-SNAPSHOT</revision>
<polaris.version>1.6.1</polaris.version>
<polaris.version>1.7.0-SNAPSHOT</polaris.version>
<logback.version>1.2.11</logback.version>
<mocktio.version>4.5.1</mocktio.version>
<byte-buddy.version>1.12.10</byte-buddy.version>

@ -134,7 +134,7 @@ public class PolarisLoadBalancer extends DynamicServerListLoadBalancer<Server> {
GetHealthyInstancesRequest request = new GetHealthyInstancesRequest();
request.setNamespace(namespace);
request.setService(serviceName);
return consumerAPI.getHealthyInstancesInstance(request);
return consumerAPI.getHealthyInstances(request);
}
}

@ -83,7 +83,7 @@ public class PolarisLoadBalancerTest {
public void testPolarisLoadBalancer() {
//mock consumerAPI
when(consumerAPI.getHealthyInstancesInstance(any())).thenReturn(this.assembleInstanceResp());
when(consumerAPI.getHealthyInstances(any())).thenReturn(this.assembleInstanceResp());
//mock routerAPI for rule
when(routerAPI.processLoadBalance(any())).thenReturn(assembleProcessLoadBalanceResp());

Loading…
Cancel
Save