YugabyteDB (2.13.0.0-b42, bfc6a6643e7399ac8a0e81d06a3ee6d6571b33ab)

Coverage Report

Created: 2022-03-09 17:30

/Users/deen/code/yugabyte-db/src/yb/integration-tests/redis_table-test.cc
Line
Count
Source (jump to first uncovered line)
1
// Copyright (c) YugaByte, Inc.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
4
// in compliance with the License.  You may obtain a copy of the License at
5
//
6
// http://www.apache.org/licenses/LICENSE-2.0
7
//
8
// Unless required by applicable law or agreed to in writing, software distributed under the License
9
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
10
// or implied.  See the License for the specific language governing permissions and limitations
11
// under the License.
12
//
13
14
#include <chrono>
15
#include <thread>
16
17
#include <glog/logging.h>
18
19
#include "yb/client/schema.h"
20
21
#include "yb/common/redis_protocol.pb.h"
22
23
#include "yb/integration-tests/redis_table_test_base.h"
24
#include "yb/integration-tests/yb_table_test_base.h"
25
26
using std::string;
27
using std::vector;
28
using std::unique_ptr;
29
30
namespace yb {
31
namespace integration_tests {
32
33
class RedisTableTest : public RedisTableTestBase {
34
};
35
36
using client::YBRedisWriteOp;
37
using client::YBColumnSchema;
38
using client::YBTableCreator;
39
using client::YBSchemaBuilder;
40
using client::YBColumnSchema;
41
using client::YBTableType;
42
using client::YBSession;
43
44
using integration_tests::YBTableTestBase;
45
46
0
TEST_F(RedisTableTest, SimpleRedisSetTest) {
47
0
  ASSERT_NO_FATALS(RedisSimpleSetCommands());
48
0
}
49
50
0
TEST_F(RedisTableTest, SimpleRedisGetTest) {
51
0
  ASSERT_NO_FATALS(RedisSimpleSetCommands());
52
0
  ASSERT_NO_FATALS(RedisSimpleGetCommands());
53
0
}
54
55
0
TEST_F(RedisTableTest, RedisTtlTest) {
56
0
  ASSERT_NO_FATALS(RedisTtlSetCommands());
57
0
  std::this_thread::sleep_for(std::chrono::milliseconds(2500));
58
0
  ASSERT_NO_FATALS(RedisTtlGetCommands());
59
0
}
60
61
0
TEST_F(RedisTableTest, RedisOverWriteTest) {
62
  // What happens when values are deleted, overwritten, rewritten with a timestamp, etc.
63
  // All writes operate in the default upsert mode
64
  // TODO: to be implemented, planning to do this on followup diff, because I want to also implement
65
  // delete command.
66
0
}
67
68
}  // namespace integration_tests
69
}  // namespace yb