traas-stack / chaosmeta

A chaos engineering platform for supporting the complete fault drill lifecycle.
https://chaosmeta.gitbook.io/chaosmeta-cn
Apache License 2.0
315 stars 54 forks source link

test: replace gomonkey with xgo in submodule chaosmeta-inject-operator #163

Open xhd2015 opened 3 months ago

xhd2015 commented 3 months ago

As described in https://github.com/traas-stack/chaosmeta/issues/161 , the xgo has been proven fine to replace gomonkey to provide better maintainability.

To run tests with xgo, first install xgo:

# macOS and Linux (and WSL)
curl -fsSL https://github.com/xhd2015/xgo/raw/master/install.sh | bash

# windows
powershell -c "irm github.com/xhd2015/xgo/raw/master/install.ps1|iex"

Then run:

cd chaosmeta-inject-operator 
xgo test -v  ./...