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

[to #526] Add codecov on Github Action #524

Merged
merged 15 commits into from
Feb 18, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
63 changes: 0 additions & 63 deletions .ci/build.groovy

This file was deleted.

6 changes: 0 additions & 6 deletions .ci/build.sh

This file was deleted.

117 changes: 0 additions & 117 deletions .ci/integration_test.groovy

This file was deleted.

8 changes: 0 additions & 8 deletions .ci/test.sh

This file was deleted.

2 changes: 1 addition & 1 deletion config/pd.toml → .github/config/pd.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PD Configuration.
[replication]
enable-placement-rules = true
max-replicas = 1
max-replicas = 1
18 changes: 18 additions & 0 deletions .github/config/tikv_rawkv.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# TiKV Configuration.

[raftstore]
# set store capacity, if no set, use disk capacity.
capacity = "8G"
pd-heartbeat-tick-interval = "2s"
pd-store-heartbeat-tick-interval = "5s"
split-region-check-tick-interval = "1s"

[storage]
enable-ttl = true

[rocksdb]
max-open-files = 10000

[raftdb]
max-open-files = 10000

14 changes: 14 additions & 0 deletions .github/config/tikv_txnkv.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# TiKV Configuration.

[raftstore]
# set store capacity, if no set, use disk capacity.
capacity = "8G"
pd-heartbeat-tick-interval = "2s"
pd-store-heartbeat-tick-interval = "5s"
split-region-check-tick-interval = "1s"

[rocksdb]
max-open-files = 10000

[raftdb]
max-open-files = 10000
71 changes: 71 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI

on:
pull_request:
push:
branches:
- master

jobs:
format:
name: Check Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8.0'
distribution: 'adopt'
- run: |
./dev/javafmt
if [[ $(git diff) != "" ]]
then
echo "code format error, please run the following commands:"
echo " ./dev/javafmt"
exit 1
fi

integration-test:
name: Integration Test - ${{ matrix.tikv_version }}
runs-on: ubuntu-latest
strategy:
matrix:
tikv_version: [nightly, v5.0.4, v5.3.0, v5.4.0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, how about [v5.0.0, v5.1.0, v5.2.0, v5.3.0, v5.4.0]?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a way to point to the latest patch release on each major.minor.patch tikv version?

Copy link
Contributor Author

@andylokandy andylokandy Feb 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid it's too much for pull request ci. It's better to do it on release or nightly ci. Anyway, tiup list tikv | awk '{print $1}' should do the job.

steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8.0'
distribution: 'adopt'
- name: Install TiUP
run: curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
- name: Start TiUP Playground
run: |
# Start TiKV in APIV1TTL
/home/runner/.tiup/bin/tiup playground ${{ matrix.tikv_version }} --mode tikv-slim --kv 1 --without-monitor --kv.config /home/runner/work/client-java/client-java/.github/config/tikv_rawkv.toml --pd.config /home/runner/work/client-java/client-java/.github/config/pd.toml &> raw.out 2>&1 &
Copy link
Member

@iosmanthus iosmanthus Feb 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about adding a step to install necessary components via tiup install <components>:<version>, then we may need not to sleep too long.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will add up the complexity of deciding which components are required by the playground.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only PD and TiKV are needed.

Copy link
Contributor Author

@andylokandy andylokandy Feb 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ngm may be needed afterwards

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested with various ways but tiup seems too easy to run into race conditions so that the sleep time can not be eliminated. So I've reverted all attempts for tiup install.


# The first run of `tiup` has to download all components so it'll take longer.
sleep 1m 30s
zz-jason marked this conversation as resolved.
Show resolved Hide resolved

# Start TiKV in APIV1
/home/runner/.tiup/bin/tiup playground ${{ matrix.tikv_version }} --mode tikv-slim --kv 1 --without-monitor --kv.config /home/runner/work/client-java/client-java/.github/config/tikv_txnkv.toml --pd.config /home/runner/work/client-java/client-java/.github/config/pd.toml &> txn.out 2>&1 &

sleep 30s

# Parse PD address from `tiup` output
echo "RAWKV_PD_ADDRESSES=$(cat raw.out | grep -oP '(?<=PD client endpoints: \[)[0-9\.:]+(?=\])')" >> $GITHUB_ENV
echo "TXNKV_PD_ADDRESSES=$(cat txn.out | grep -oP '(?<=PD client endpoints: \[)[0-9\.:]+(?=\])')" >> $GITHUB_ENV

# Log the output
echo "$(cat raw.out)" >&2
echo "$(cat txn.out)" >&2
- name: Run Integration Test
run: mvn clean test
- name: Upload coverage
uses: codecov/codecov-action@v2
with:
files: ${{ github.workspace }}/target/site/jacoco/jacoco.xml
fail_ci_if_error: true
verbose: true
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Maven Central](https://img.shields.io/maven-central/v/org.tikv/tikv-client-java.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22org.tikv%22%20AND%20a:%22tikv-client-java%22)
[![Slack](https://img.shields.io/badge/chat-on%20Slack-brightgreen.svg)](https://slack.tidb.io/invite?team=tikv-wg&channel=client)
[![codecov](https://codecov.io/gh/tikv/client-java/branch/master/graph/badge.svg?token=nSAjGaN0EH)](https://codecov.io/gh/tikv/client-java)

## TiKV JAVA Client

Expand Down
8 changes: 0 additions & 8 deletions config/tikv_rawkv.toml

This file was deleted.

5 changes: 0 additions & 5 deletions config/tikv_txnkv.toml

This file was deleted.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@
</execution>
<execution>
<id>jacoco-site</id>
<phase>package</phase>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
Expand Down