forked from fl00r/go-tarantool-1.6
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: handle everything with go test
Before this patch, it was required to set up test tarantool processes manually (and also handle their dependencies, like making working dir). You can see an example in CI scripts. This patch introduces go helpers for starting a tarantool process and installing rock requirements with tarantoolctl. Helpers are based on `os/exec` calls. Retries to connect test tarantool instance handled explicitly, see #136. Setup scripts are reworked to use environment variables to configure `box.cfg`. Listen port is set in the end of script so it is possible to connect only if every other thing was set up already. Every test is reworked to start a tarantool process (or processes) in TestMain before test run. Now it is possible to run a test with plain `go test`. Queue tests changes may be broken because it is impossible to verify before #115 is fixed. Closes #107
- Loading branch information
1 parent
8ad21b2
commit 510da5f
Showing
14 changed files
with
326 additions
and
76 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
*.DS_Store | ||
*.swp | ||
.idea/ | ||
snap | ||
xlog | ||
work_dir* | ||
.rocks |
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,19 @@ | ||
local nodes_load = require("config_load_nodes") | ||
|
||
-- Do not set listen for now so connector won't be | ||
-- able to send requests until everything is configured. | ||
box.cfg{ | ||
work_dir = os.getenv("TARANTOOL_WORK_DIR"), | ||
} | ||
|
||
get_cluster_nodes = nodes_load.get_cluster_nodes | ||
|
||
box.once("init", function() | ||
box.schema.user.create('test', { password = 'test' }) | ||
box.schema.user.grant('test', 'read,write,execute', 'universe') | ||
end) | ||
|
||
-- Set listen only when every other thing is configured. | ||
box.cfg{ | ||
listen = os.getenv("TARANTOOL_LISTEN"), | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.