-
Notifications
You must be signed in to change notification settings - Fork 70
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
Move all documentation examples to separate test files #3055
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
6af0e93
add initial framework examples
jbrinkman 3f02f1b
fix naming
jbrinkman 2d9e9cd
add string commands examples
jbrinkman b5f9d4c
started a new cleaner branch and added commands
edlng 7e98df2
create examples for string commands
jbrinkman 86f03a6
interim save for stream commands tests
jbrinkman e8d5a6a
Added sorted set command examples
edlng 2577435
Removed leftover example comments in BaseClient and GlideClient
edlng d793226
interim save for stream commands tests
jbrinkman 176c1a9
interim save for stream commands tests - revert go.mod changes and fi…
jbrinkman 44876aa
finish stream and set examples
jbrinkman 1db0739
cleanup base client to remove examples
jbrinkman a95b79c
cleanup rebase issues
jbrinkman 62ad3c9
move examples for BZMPop
jbrinkman e578845
fix linting errors due to formatting problems
jbrinkman daab272
split unit-tests and example-tests in makefile
jbrinkman 2a8c5ee
remove hardcoded references to localhost and port 6379
jbrinkman 79c7d29
fix build error
jbrinkman e03fd97
update unit-test make task to work in go 1.20
jbrinkman 39f7397
fix linting errors due to formatting problems
jbrinkman e8ac07b
fix makefile for unit-test and example-tests to use test-filter
jbrinkman b0345eb
add copyright statement in example files
jbrinkman 730addf
Fixed failing tests and added automation in Makefile
edlng 3c76ad5
Fixed crashing examples test
edlng ad951a4
change cluster ports - port 7000 is used by MacOS control center
jbrinkman 6291226
fix api package reference
jbrinkman 3db97f3
fix formatting
jbrinkman a449c8b
fix makefile for running examples
jbrinkman c356af8
fix generic command examples
jbrinkman 0d3972d
Update go/api/base_client.go
jbrinkman f93896e
Update go/api/base_client.go
jbrinkman 55174ce
Update go/api/base_client.go
jbrinkman 9de7806
Update go/api/base_client.go
jbrinkman d092526
fix more format/lint problems
jbrinkman da6b439
replace use of testify with go-cmp in examples
jbrinkman 335dc93
remove use of go-cmp which seems to have issues
jbrinkman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,7 @@ build-glide-client: | |
else \ | ||
strip --strip-unneeded target/release/libglide_rs.a; \ | ||
fi | ||
|
||
|
||
build-glide-client-debug: | ||
cargo build | ||
|
@@ -83,14 +83,28 @@ format: | |
gofumpt -w . | ||
golines -w --shorten-comments -m 127 . | ||
|
||
# unit tests - skip complete IT suite (including MT) | ||
# unit tests - skip complete IT suite (including MT), and examples | ||
# due to a bug in go 1.20 and 1.21, we need to use -run flag to get -skip flag to work | ||
unit-test: | ||
mkdir -p reports | ||
set -o pipefail; \ | ||
LD_LIBRARY_PATH=$(shell find . -name libglide_rs.a|grep -w release|tail -1|xargs dirname|xargs readlink -f):${LD_LIBRARY_PATH} \ | ||
go test -v -race ./... -skip TestGlideTestSuite $(if $(test-filter), -testify.m $(test-filter)) \ | ||
go test -v -race ./... -skip 'Example|TestGlideTestSuite' -run Test $(if $(test-filter), -run $(test-filter)) \ | ||
| tee >(go tool test2json -t -p github.com/valkey-io/valkey-glide/go/utils | go-test-report -o reports/unit-tests.html -t unit-test > /dev/null) | ||
|
||
# example tests - skip complete IT suite (including MT) | ||
example-test: | ||
mkdir -p reports | ||
set -o pipefail; \ | ||
../utils/cluster_manager.py start -p 6379 -r 0 | ||
../utils/cluster_manager.py start --cluster-mode -p 7001 7002 7003 7004 7005 7006 | ||
Comment on lines
+99
to
+100
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Try to randomise ports to avoid collision |
||
LD_LIBRARY_PATH=$(shell find . -name libglide_rs.a|grep -w release|tail -1|xargs dirname|xargs readlink -f):${LD_LIBRARY_PATH} \ | ||
go test -v -race ./... -skip Test $(if $(test-filter), -run $(test-filter)) \ | ||
| tee >(go tool test2json -t -p github.com/valkey-io/valkey-glide/go/api \ | ||
| go-test-report -o reports/example-tests.html -t example-test > /dev/null) | ||
|
||
../utils/cluster_manager.py stop --prefix cluster | ||
|
||
# integration tests - run subtask with skipping modules tests | ||
integ-test: export TEST_FILTER = -skip TestGlideTestSuite/TestModule $(if $(test-filter), -testify.m $(test-filter)) | ||
integ-test: __it | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider updating developer guide