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

test: support codecov #11

Merged
merged 42 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
bb83e57
move pagckage
funky-eyes Apr 7, 2024
6c4d70c
feature: Add performance report and help prompt
funky-eyes Apr 7, 2024
7745e20
feature: Add performance report and help prompt
funky-eyes Apr 7, 2024
0eae9b5
feature: Add performance report and help prompt
funky-eyes Apr 7, 2024
8bbb7ac
feature: Add performance report and help prompt
funky-eyes Apr 7, 2024
b07663d
feature: Add performance report and help prompt
funky-eyes Apr 7, 2024
393e92f
feature: Add performance report and help prompt
funky-eyes Apr 7, 2024
a3c4642
feature: Add performance report and help prompt
funky-eyes Apr 7, 2024
986c561
feature: Add performance report and help prompt
funky-eyes Apr 7, 2024
561dc24
feature: Add performance report and help prompt
funky-eyes Apr 7, 2024
c1d088c
test
funky-eyes Apr 7, 2024
08e0852
test
funky-eyes Apr 7, 2024
60431d8
test
funky-eyes Apr 7, 2024
a4447a1
test
funky-eyes Apr 7, 2024
bd1ca22
test
funky-eyes Apr 7, 2024
c346871
test
funky-eyes Apr 7, 2024
a98978f
feature: support hset protocol
funky-eyes Apr 7, 2024
192ce6f
feature: support hset protocol
funky-eyes Apr 7, 2024
66eeda0
feature: support hset protocol
funky-eyes Apr 7, 2024
290bc38
feature: support hset protocol
funky-eyes Apr 7, 2024
e7509c8
feature: support hset protocol
funky-eyes Apr 7, 2024
b951bc0
feature: support hset protocol
funky-eyes Apr 7, 2024
464421e
Merge branch 'main' of github.com:funky-eyes/redispike-proxy into 0407
funky-eyes Apr 7, 2024
e309053
optimize: update benchmark report
funky-eyes Apr 7, 2024
faa9631
feature: support hdel protocol
funky-eyes Apr 7, 2024
9232309
feature: support hdel protocol
funky-eyes Apr 7, 2024
9d79bfd
feature: support hdel protocol
funky-eyes Apr 7, 2024
c5f79f4
feature: support del protocol
funky-eyes Apr 7, 2024
d808145
test
funky-eyes Apr 7, 2024
99a4337
test
funky-eyes Apr 7, 2024
5047fa0
test
funky-eyes Apr 7, 2024
cde9958
Merge branch 'main' of github.com:funky-eyes/redis2asp into 0407
funky-eyes Apr 7, 2024
b9704e5
test
funky-eyes Apr 7, 2024
f43d226
test
funky-eyes Apr 7, 2024
7473369
test
funky-eyes Apr 7, 2024
e4f0413
test
funky-eyes Apr 7, 2024
031d98f
test
funky-eyes Apr 7, 2024
0c65cf0
test
funky-eyes Apr 7, 2024
ff6c99c
test
funky-eyes Apr 7, 2024
3227a92
test
funky-eyes Apr 7, 2024
fb0b25e
test
funky-eyes Apr 7, 2024
f63b630
test
funky-eyes Apr 7, 2024
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
15 changes: 6 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,19 @@ jobs:
java: [ 8, 21 ]
steps:
- name: "Checkout"
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: "Set up Java JDK"
uses: actions/setup-java@v3.12.0
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- name: "Print maven version"
run: ./mvnw -version
- name: "Test, Check style, Check PMD, Check license with Maven and Java8"
if: matrix.java == '8'
- name: "Test, Check style, Check PMD, Check license with Maven and Java"
run: |
./mvnw -T 4C clean test && sh ./tools/check_format.sh
- name: "Test with Maven and Java${{ matrix.java }}"
if: matrix.java != '8'
run: |
./mvnw -T 4C clean test
- name: "Codecov"
if: matrix.java == '8'
uses: codecov/[email protected]
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
8 changes: 4 additions & 4 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ coverage:
precision: 2
range: "50...100"
ignore:
- ".github/.*"
- ".mvn/.*"
- ".style/.*"
- "*.md"
- ".github/.*"
- ".mvn/.*"
- ".style/.*"
- "*.md"
comment:
layout: "reach,diff,flags,tree"
behavior: default
Expand Down
20 changes: 20 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,26 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
20 changes: 11 additions & 9 deletions src/test/java/icu/funkye/redispike/ServerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ public class ServerTest {
static Server server;
static IAerospikeClient aspClient;

static Logger logger = LoggerFactory.getLogger(ServerTest.class);
static Logger logger = LoggerFactory.getLogger(ServerTest.class);

private final int RandomValue = Integer.MAX_VALUE;

@BeforeAll
public static void init() throws ParseException {
Expand All @@ -53,7 +55,7 @@ public static void init() throws ParseException {

@Test
public void testhHash() {
String key = String.valueOf(ThreadLocalRandom.current().nextInt(50000));
String key = String.valueOf(ThreadLocalRandom.current().nextInt(RandomValue));
try (Jedis jedis = JedisPooledFactory.getJedisInstance()) {
Long result = jedis.hset(key.getBytes(StandardCharsets.UTF_8), "b".getBytes(StandardCharsets.UTF_8),
"c".getBytes(StandardCharsets.UTF_8));
Expand All @@ -67,7 +69,7 @@ public void testhHash() {
Assertions.assertEquals(result, 2);
result = jedis.hdel(key, map.keySet().toArray(new String[0]));
Assertions.assertEquals(result, 2);
key = String.valueOf(ThreadLocalRandom.current().nextInt(50000));
key = String.valueOf(ThreadLocalRandom.current().nextInt(RandomValue));
result = jedis.hsetnx(key, "f", "g");
Assertions.assertEquals(result, 1);
result = jedis.hsetnx(key, "f", "g");
Expand Down Expand Up @@ -114,7 +116,7 @@ public void testGetNilAsp() {

@Test
public void testSetExAsp() {
String key = String.valueOf(ThreadLocalRandom.current().nextInt(50000));
String key = String.valueOf(ThreadLocalRandom.current().nextInt(RandomValue));
try (Jedis jedis = JedisPooledFactory.getJedisInstance()) {
String result = jedis.set(key, "b", SetParams.setParams().ex(1L));
Assertions.assertEquals(result, "OK");
Expand All @@ -128,13 +130,13 @@ public void testSetExAsp() {

@Test
public void testSetNxNilAsp() {
String key = String.valueOf(ThreadLocalRandom.current().nextInt(50000));
String key = String.valueOf(ThreadLocalRandom.current().nextInt(RandomValue));
try (Jedis jedis = JedisPooledFactory.getJedisInstance()) {
String result = jedis.set(key, "b", SetParams.setParams().nx());
Assertions.assertEquals(result, "OK");
result = jedis.set(key, "b", SetParams.setParams().nx());
Assertions.assertNull(result);
key = String.valueOf(ThreadLocalRandom.current().nextInt(50000));
key = String.valueOf(ThreadLocalRandom.current().nextInt(RandomValue));
result = String.valueOf(jedis.setnx(key, "b"));
Assertions.assertEquals(result, "1");
result = String.valueOf(jedis.setnx(key, "b"));
Expand All @@ -144,7 +146,7 @@ public void testSetNxNilAsp() {

@Test
public void testSetExNxAsp() {
String key = String.valueOf(ThreadLocalRandom.current().nextInt(50000));
String key = String.valueOf(ThreadLocalRandom.current().nextInt(RandomValue));
try (Jedis jedis = JedisPooledFactory.getJedisInstance()) {
String result = jedis.set(key, "b", SetParams.setParams().nx().ex(1L));
Assertions.assertEquals(result, "OK");
Expand All @@ -158,7 +160,7 @@ public void testSetExNxAsp() {

@Test
public void testDelAsp() {
String key = String.valueOf(ThreadLocalRandom.current().nextInt(50000));
String key = String.valueOf(ThreadLocalRandom.current().nextInt(RandomValue));
try (Jedis jedis = JedisPooledFactory.getJedisInstance()) {
String result = jedis.set(key, "b");
Assertions.assertEquals(result, "OK");
Expand All @@ -171,7 +173,7 @@ public void testDelAsp() {
public void testBatchDelAsp() {
List<String> keys = new ArrayList<>();
for (int i = 0; i < 2; i++) {
keys.add(String.valueOf(ThreadLocalRandom.current().nextInt(50000)));
keys.add(String.valueOf(ThreadLocalRandom.current().nextInt(RandomValue)));
}
try (Jedis jedis = JedisPooledFactory.getJedisInstance()) {
String result = jedis.set(keys.get(0), "b");
Expand Down