-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support build etcd with failpoint (#2)
* feat: support build etcd with failpoint * chore: add e2e test * chore: fix e2e test * chore: fix e2e test * fix: BUILD_WITH_FAILPOINT condition * fix: BUILD_WITH_FAILPOINT condition * fix: vfox use when etcd build with failpoint * opt: vfox use flow * chore(e2e): check failpoint * chore(e2e): fix macos go * docs: update plugin desc * chore: fix ci * docs: update README * docs: update README ref link
- Loading branch information
Showing
8 changed files
with
116 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ name: E2E tests | |
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
@@ -38,8 +39,14 @@ jobs: | |
scoop install vfox | ||
- name: add vfox-etcd plugin | ||
if: runner.os == 'Windows' | ||
run: | | ||
vfox add --source https://github.com/version-fox/vfox-etcd/archive/$env:GITHUB_REF.zip etcd | ||
- name: add vfox-etcd plugin | ||
if: runner.os != 'Windows' | ||
run: | | ||
vfox add --source https://github.com/version-fox/vfox-etcd/archive/refs/heads/main.zip etcd | ||
vfox add --source https://github.com/version-fox/vfox-etcd/archive/${GITHUB_REF}.zip etcd | ||
- name: install etcd by vfox-etcd plugin (Linux) | ||
if: runner.os == 'Linux' | ||
|
@@ -72,4 +79,51 @@ jobs: | |
echo "===============PATH===============" | ||
echo $env:PATH | ||
echo "===============PATH===============" | ||
etcd -version | ||
etcd -version | ||
- name: install etcd with failpoint by vfox-etcd plugin (Linux) | ||
if: runner.os == 'Linux' | ||
run: | | ||
export BUILD_WITH_FAILPOINT=yes | ||
vfox install [email protected] | ||
vfox use -g [email protected] | ||
eval "$(vfox activate bash)" | ||
echo "===============PATH===============" | ||
echo $PATH | ||
echo "===============PATH===============" | ||
etcd -version | ||
export GOFAIL_HTTP="127.0.0.1:22381" | ||
nohup etcd > etcd.log 2>&1 & | ||
output=$(curl http://127.0.0.1:22381 | grep afterCommit) | ||
if [ -n "$output" ]; then | ||
echo "etcd with failpoint" | ||
echo $output | ||
else | ||
echo "etcd does not with failpoint" | ||
echo $output | ||
exit 1 | ||
fi | ||
- name: install etcd with failpoint by vfox-etcd plugin (MacOS) | ||
if: runner.os == 'MacOS' | ||
run: | | ||
brew install go | ||
export BUILD_WITH_FAILPOINT=yes | ||
vfox install [email protected] | ||
vfox use -g [email protected] | ||
eval "$(vfox activate bash)" | ||
echo "===============PATH===============" | ||
echo $PATH | ||
echo "===============PATH===============" | ||
etcd -version | ||
export GOFAIL_HTTP="127.0.0.1:22381" | ||
nohup etcd > etcd.log 2>&1 & | ||
output=$(curl http://127.0.0.1:22381 | grep afterCommit) | ||
if [ -n "$output" ]; then | ||
echo "etcd with failpoint" | ||
echo $output | ||
else | ||
echo "etcd does not with failpoint" | ||
echo $output | ||
exit 1 | ||
fi |
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 |
---|---|---|
|
@@ -8,16 +8,37 @@ | |
|
||
# vfox-etcd plugin | ||
|
||
etcd [vfox](https://github.com/version-fox) plugin. Use the vfox to manage multiple [etcd](https://etcd.io/) versions in Linux/Darwin MacOS/Windows. | ||
etcd [vfox](https://github.com/version-fox) plugin. Use the vfox to manage multiple [etcd](https://etcd.io/) & etcdctl & etcductl versions in Linux/Darwin MacOS/Windows. Also can be used to build etcd with [failpoint](https://github.com/etcd-io/etcd/tree/main/tests/robustness#running-locally). | ||
|
||
## Usage | ||
|
||
```shell | ||
# install plugin | ||
vfox add --source https://github.com/version-fox/vfox-etcd/archive/refs/heads/main.zip etcd | ||
|
||
# install an available version | ||
# install an available etcd version | ||
vofx search etcd | ||
# or specific version | ||
vfox install [email protected] | ||
``` | ||
|
||
### etcd with failpoint (Only support in Unix-like OS system) | ||
|
||
For the [chaos testing](https://testsigma.com/blog/chaos-testing/) proposal, you can also utilize vfox-etcd to build etcd with failpoint. Example: | ||
|
||
**Requirements:** | ||
|
||
- [Go 1.21+](https://go.dev/) | ||
- [GNU Make](https://www.gnu.org/software/make/) | ||
|
||
```shell | ||
# install etcd with failpoint | ||
BUILD_WITH_FAILPOINT=yes vfox install [email protected] | ||
|
||
vfox use [email protected] | ||
# start etcd with failpoint | ||
GOFAIL_HTTP="127.0.0.1:22381" etcd | ||
|
||
# get all failpoint | ||
curl http://127.0.0.1:22381 | ||
``` |
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
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