From 115ca445db9a791947f705909f0093c822f2b3de Mon Sep 17 00:00:00 2001 From: Feng Shang Date: Tue, 7 Jun 2022 12:15:43 +0800 Subject: [PATCH 1/2] chore: update demo, and try codecov --- .github/workflows/build.yml | 5 ++--- .../sdk/example/FeatureProbeDemo.java | 15 ++++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7fdeb33..a9c7460 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,3 @@ - name: Build & Tests on: @@ -23,5 +22,5 @@ jobs: - name: Build with Maven run: mvn -B package --file pom.xml - - name: Coveralls Upload - run: mvn test jacoco:report coveralls:report --define repoToken=${{ secrets.COVERALL_REPO_TOKEN }} + - name: Upload coverage reports to Codecov with GitHub Action + uses: codecov/codecov-action@v3 \ No newline at end of file diff --git a/src/main/java/com/featureprobe/sdk/example/FeatureProbeDemo.java b/src/main/java/com/featureprobe/sdk/example/FeatureProbeDemo.java index 3d9a0f5..5af526f 100644 --- a/src/main/java/com/featureprobe/sdk/example/FeatureProbeDemo.java +++ b/src/main/java/com/featureprobe/sdk/example/FeatureProbeDemo.java @@ -25,19 +25,20 @@ public static void main(String[] args) { FPUser user = new FPUser("user_id"); user.with("city", "New York"); - double discount = fpClient.numberValue("commodity_spike_activity", user, 0); - System.out.println("user1 discount is :" + discount); - FPDetail detail = fpClient.numberDetail("commodity_spike_activity", user, 0); + double discount = fpClient.numberValue("promotion_activity", user, 0); + System.out.println("user in New York discount is :" + discount); + FPDetail detail = fpClient.numberDetail("promotion_activity", user, 0); System.out.println("detail:" + detail.getReason()); + System.out.println("rule index:" + detail.getRuleIndex()); FPUser user2 = new FPUser("user_id2"); user2.with("city", "Paris"); - discount = fpClient.numberValue("commodity_spike_activity", user2, 0); - System.out.println("user2 discount is :" + discount); - FPDetail detail2 = fpClient.numberDetail("commodity_spike_activity", user2, 0); + discount = fpClient.numberValue("promotion_activity", user2, 0); + System.out.println("user in Paris discount is :" + discount); + FPDetail detail2 = fpClient.numberDetail("promotion_activity", user2, 0); System.out.println("detail2:" + detail2.getReason()); - System.out.println("rule index:" + detail2.getRuleIndex().get()); + System.out.println("rule index:" + detail2.getRuleIndex()); } } From 71c875b33c8f53776a09f8d74a31e3847720b8b7 Mon Sep 17 00:00:00 2001 From: Feng Shang Date: Tue, 7 Jun 2022 12:29:24 +0800 Subject: [PATCH 2/2] chore: update demo, and try codecov --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a9c7460..145daef 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,4 +23,4 @@ jobs: run: mvn -B package --file pom.xml - name: Upload coverage reports to Codecov with GitHub Action - uses: codecov/codecov-action@v3 \ No newline at end of file + uses: codecov/codecov-action@v2 \ No newline at end of file