-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: spop binlog , rewritten as srem (#2541)
* fix: spop binlog
- Loading branch information
1 parent
6218b5e
commit b63a69d
Showing
5 changed files
with
197 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# README | ||
This is an integration test code for Pika written in Golang. By default, the tests are automatically executed after code is submitted to the Pika repository. | ||
|
||
[中文](https://github.com/OpenAtomFoundation/pika/blob/unstable/tests/integration/README_CN.md) | ||
|
||
## Running Golang Integration Tests Locally | ||
If you want to run the tests locally, you need to complete the following preparations: | ||
|
||
### 1. Prepare the Program and Configuration Files | ||
Ensure that the compiled Pika program is present in the ../../output/pika directory. | ||
(You can also compile the Pika program for Mac in advance and manually copy the Pika file to the directory specified in start_master_and_slave.sh, copy the unchanged pika configuration files to the test directory; or directly modify the startup path in start_master_and_slave.sh.) | ||
|
||
The prerequisite for manually executing the tests is having Ginkgo installed, for example: | ||
``` | ||
cd tests/integration/ | ||
go get github.com/onsi/ginkgo/v2/ginkgo | ||
go install github.com/onsi/ginkgo/v2/ginkgo | ||
go get github.com/onsi/gomega/... | ||
``` | ||
|
||
### 2.Start the Pika Service | ||
Execute in the project root directory: | ||
``` | ||
cd tests | ||
sh ./integration/start_master_and_slave.sh | ||
``` | ||
|
||
### 3.Run Tests | ||
Execute in the tests directory: | ||
``` | ||
cd integration | ||
sh integrate_test.sh | ||
``` | ||
|
||
### 4.Run Tests for a Specific File | ||
|
||
Add environment variables: | ||
``` | ||
go env |grep GOBIN | ||
export PATH="$PATH:$GOBIN" | ||
``` | ||
|
||
Execute`ginkgo --focus-file="slowlog_test.go" -vv` | ||
|
||
Refer to the Ginkgo framework: https://onsi.github.io/ginkgo/#mental-model-ginkgo-assumes-specs-are-independent | ||
Note: | ||
`--focus-file` executes matching files | ||
|
||
`--skip-file` filters out non-matching files | ||
|
||
`--focus` executes tests matching descriptions | ||
|
||
`--skip` filters out tests matching descriptions | ||
|
||
For example, `ginkgo --focus=dog --focus=fish --skip=cat --skip=purple` | ||
|
||
This will only run tests described as "likes dogs", "likes dog fish", while skipping tests related to "purple". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# README | ||
这是用golang编写的pika 集成测试代码,默认提交代码到pika仓库后会自动运行。 | ||
|
||
## 本地跑golang集成测试 | ||
如果你想在本地运行测试,需要完成以下的准备工作: | ||
|
||
### 1.准备程序和配置文件 | ||
在../../output/pika目录确保有编译好的pika程序。 | ||
(也可以提前编译好mac版本的pika程序,并手动将pika文件拷贝到start_master_and_slave.sh中制定的目录,将pika未改动的conf文件拷贝到test目录;或者直接修改start_master_and_slave.sh启动路径。) | ||
|
||
手动执行测试的前提是,已安装ginkgo,例如 | ||
``` | ||
cd tests/integration/ | ||
go get github.com/onsi/ginkgo/v2/ginkgo | ||
go install github.com/onsi/ginkgo/v2/ginkgo | ||
go get github.com/onsi/gomega/... | ||
``` | ||
|
||
### 2.启动Pika服务 | ||
在项目主目录下执行 | ||
``` | ||
cd tests | ||
sh ./integration/start_master_and_slave.sh | ||
``` | ||
|
||
### 3.运行测试 | ||
在tests目录下执行 | ||
cd integration | ||
sh integrate_test.sh | ||
|
||
### 4.运行指定文件的测试 | ||
|
||
|
||
添加环境变量 | ||
``` | ||
go env |grep GOBIN | ||
export PATH="$PATH:$GOBIN" | ||
``` | ||
|
||
执行`ginkgo --focus-file="slowlog_test.go" -vv` | ||
|
||
ginkgo框架参考: https://onsi.github.io/ginkgo/#mental-model-ginkgo-assumes-specs-are-independent | ||
备注: | ||
`--focus-file`执行匹配文件 | ||
`--skip-file`过滤不匹配的文件 | ||
`--focus`执行匹配描述的测试 | ||
`--skip`过滤匹配描述的测试 | ||
例如,`ginkgo --focus=dog --focus=fish --skip=cat --skip=purple` | ||
则只运行运行It(描述内容中)例如"likes dogs"、"likes dog fish"的单测,而跳过"purple"相关的测试。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters