Skip to content

Commit

Permalink
rename: rename lots of things (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
fenollp authored Jan 6, 2018
1 parent 4b2cea4 commit 6150948
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 54 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ vendor/

# End of https://www.gitignore.io/api/go

testman
testman-*
monkey
monkey-*
schemas.go
sha256s.txt
20 changes: 10 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,21 @@ script:
# - ! ag ', err = [^;\n]+$\n\s+if err != nil' # lint: if can be inlined
- bash -c "! git --no-pager grep -InE 'log.Println\(\"\[...\] \",'" # lint: log.Println does not need the space before log level
- golint -set_exit_status
- printf 'package main\nconst binVersion = "%s"' $CURRENT_TAG | gofmt >version.go
- GIT_DESCRIBE=$(git describe --abbrev --dirty --always --tags)
- printf 'package main\nconst binVersion = "%s"\nconst binVSN = "%s"' $CURRENT_TAG $GIT_DESCRIBE | gofmt >version.go
- go generate
- dep ensure -v
- go fmt
- git --no-pager diff
- bash -c '[[ 0 -eq $(git --no-pager diff --name-only | grep -v version.go | wc -l) ]]'
- go vet $(go list ./... | grep -v /vendor/)
#- go test -v -race .
- GIT_DESCRIBE=$(git describe --abbrev --dirty --always --tags)
- gox -os 'linux darwin windows' -arch 'amd64' -output 'testman-{{.OSUname}}-{{.ArchUname}}' -ldflags '-s -w -X main.Rev='$GIT_DESCRIBE -verbose .
- ./testman-Linux-x86_64 -h | grep testman
- ./testman-Linux-x86_64 --help | grep testman
- ./testman-Linux-x86_64 -V | grep testman/$CURRENT_TAG
- ./testman-Linux-x86_64 --version | grep testman/$CURRENT_TAG
- for bin in testman-*; do sha256sum $bin; done | tee sha256s.txt
- gox -os 'linux darwin windows' -arch 'amd64' -output 'monkey-{{.OSUname}}-{{.ArchUname}}' -ldflags '-s -w -X main.Rev='$GIT_DESCRIBE -verbose .
- ./monkey-Linux-x86_64 -h | grep monkey
- ./monkey-Linux-x86_64 --help | grep monkey
- ./monkey-Linux-x86_64 -V | grep monkey/$CURRENT_TAG
- ./monkey-Linux-x86_64 --version | grep monkey/$CURRENT_TAG
- for bin in monkey-*; do sha256sum $bin; done | tee sha256s.txt
- sha256sum --check --strict sha256s.txt
- ls -lha

Expand All @@ -71,10 +71,10 @@ deploy:
overwrite: true
file_glob: true
file:
- testman-*
- monkey-*
- sha256s.txt
on:
repo: CoveredCI/testman
repo: FuzzyMonkeyCo/monkey
tags: true

notifications:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: debug lint

EXE = testman
EXE = monkey

all: lint vendor/
go generate
Expand All @@ -15,7 +15,7 @@ lint:

debug: all
./$(EXE) validate
./$(EXE) -vvv test
./$(EXE) -vvv fuzz

clean:
$(if $(wildcard vendor/),rm -r vendor/)
Expand Down
31 changes: 22 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,35 @@
# [testman](https://github.com/CoveredCI/testman) ~ CoveredCI's minion [![TravisCI build status](https://travis-ci.org/CoveredCI/testman.svg?branch=master)](https://travis-ci.org/CoveredCI/testman/builds) [![Goreport card](https://goreportcard.com/badge/github.com/CoveredCI/testman)](https://goreportcard.com/report/github.com/CoveredCI/testman)
# [monkey](https://github.com/FuzzyMonkeyCo/monkey) ~ FuzzyMonkeyCo's minion [![TravisCI build status](https://travis-ci.org/FuzzyMonkeyCo/monkey.svg?branch=master)](https://travis-ci.org/FuzzyMonkeyCo/monkey/builds) [![Goreport card](https://goreportcard.com/badge/github.com/FuzzyMonkeyCo/monkey)](https://goreportcard.com/report/github.com/FuzzyMonkeyCo/monkey)

[CoveredCI](https://coveredci.com) is an automated JSON API testing service based on QuickCheck.
[FuzzyMonkey](https://fuzzymonkey.co) is an automated JSON API testing service based on QuickCheck.

[testman](https://github.com/CoveredCI/testman) is the official open source client that executes the tests CoveredCI generates.
[monkey](https://github.com/FuzzyMonkeyCo/monkey) is the official open source client that executes the tests FuzzyMonkey generates.

### Quick install
### Getting started

Quick install:

```shell
sh <(curl -sfSL https://goo.gl/Wb1JeU)
sh <(curl -fsSL http://goo.gl/3d7tPe)
```

or the equivalent:

```shell
sh <(curl -sfSL https://raw.githubusercontent.com/CoveredCI/testman/master/misc/latest.sh)
sh <(curl -fsSL https://raw.githubusercontent.com/FuzzyMonkeyCo/monkey/master/misc/latest.sh)
```

Then run:

```shell
$ monkey fuzz
No validation errors found.
✓✓✓✓✓✓✓✓✓✓✗
✗✗✓✓✓✓✓✓✓
Ran 20 tests totalling 47 requests
A bug was detected after 11 tests then shrunk 9 times!
```

### Example `.coveredci.yml` file:
### Example `.fuzzymonkey.yml` file:

```yaml
version: 0
Expand All @@ -29,7 +42,7 @@ reset:
- curl --fail -X DELETE http://localhost:6773/api/1/items
```
### A more involved `.coveredci.yml`
### A more involved `.fuzzymonkey.yml`

```yaml
version: 0
Expand Down Expand Up @@ -61,4 +74,4 @@ stop:

### Issues?

Report bugs [on the project page](https://github.com/coveredCI/testman/issues) or [contact us](mailto:hi@coveredci.co).
Report bugs [on the project page](https://github.com/FuzzyMonkeyCo/monkey/issues) or [contact us](mailto:ook@fuzzymonkey.co).
2 changes: 1 addition & 1 deletion check_latest.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

const (
githubV3APIHeader = "application/vnd.github.v3+json"
latestReleaseURL = "https://api.github.com/repos/CoveredCI/testman/releases/latest"
latestReleaseURL = "https://api.github.com/repos/FuzzyMonkeyCo/monkey/releases/latest"
// jqQuery = "{tag:.tag_name, bins:.assets|map({(.name): .browser_download_url})|add}"
jqQuery = ".tag_name"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd_done.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (cmd *doneCmd) Exec(cfg *ymlCfg) ([]byte, error) {
return nil, nil
}

func testOutcome(cmd *doneCmd) int {
func fuzzOutcome(cmd *doneCmd) int {
os.Stdout.Write([]byte{'\n'})
fmt.Printf("Ran %d tests totalling %d requests\n", lastLane.T, totalR)

Expand Down
2 changes: 1 addition & 1 deletion cmd_req.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (cmd *reqCmd) updateURL(cfg *ymlCfg) (err error) {
func (cmd *reqCmd) updateUserAgent() {
for i := range cmd.HARRequest.Headers {
if cmd.HARRequest.Headers[i].Name == "User-Agent" {
if cmd.HARRequest.Headers[i].Value == "CoveredCI-passthrough/1" {
if cmd.HARRequest.Headers[i].Value == "FuzzyMonkey-passthrough/1" {
cmd.HARRequest.Headers[i].Value = binTitle
break
}
Expand Down
34 changes: 17 additions & 17 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
//go:generate go run misc/include_jsons.go

const (
binName = "testman"
binName = "monkey"
binTitle = binName + "/" + binVersion
envAPIKey = "COVEREDCI_API_KEY"
envAPIKey = "FUZZYMONKEY_API_KEY"
)

var (
Expand All @@ -34,12 +34,12 @@ func init() {
isDebug = "0.0.0" == binVersion

if isDebug {
apiRoot = "http://test.dev.coveredci.com/1"
docsURL = "http://lint.dev.coveredci.com/1/blob"
apiRoot = "http://fuzz.dev.fuzzymonkey.co/1"
docsURL = "http://lint.dev.fuzzymonkey.co/1/blob"
} else {
//FIXME: use HTTPS
apiRoot = "http://test.coveredci.com/1"
docsURL = "http://lint.coveredci.com/1/blob"
apiRoot = "http://fuzz.fuzzymonkey.co/1"
docsURL = "http://lint.fuzzymonkey.co/1/blob"
}
initURL = apiRoot + "/init"
nextURL = apiRoot + "/next"
Expand All @@ -54,13 +54,13 @@ func main() {
}

func usage() (map[string]interface{}, error) {
usage := `testman
usage := binName + " v" + binVersion + " " + binVSN + `
Usage:
testman [-vvv] test
testman [-vvv] validate
testman -h | --help
testman -V | --version
` + binName + ` [-vvv] fuzz
` + binName + ` [-vvv] validate
` + binName + ` -h | --help
` + binName + ` -V | --version
Options:
-v, -vv, -vvv Verbosity level
Expand Down Expand Up @@ -103,8 +103,8 @@ func actualMain() int {
return doValidate(apiKey)
}

// args["test"].(bool) = true
return doTest(apiKey)
// args["fuzz"].(bool) = true
return doFuzz(apiKey)
}

func ensureDeleted(path string) {
Expand Down Expand Up @@ -167,7 +167,7 @@ func doValidate(apiKey string) int {
return retryOrReport()
}

func doTest(apiKey string) int {
func doFuzz(apiKey string) int {
if _, err := os.Stat(shell()); os.IsNotExist(err) {
log.Printf("%s is required\n", shell())
return 5
Expand Down Expand Up @@ -198,7 +198,7 @@ func doTest(apiKey string) int {
for {
if cmd.Kind() == "done" {
ensureDeleted(envSerializedPath)
return testOutcome(cmd.(*doneCmd))
return fuzzOutcome(cmd.(*doneCmd))
}

if cmd, err = next(cfg, cmd); err != nil {
Expand All @@ -214,8 +214,8 @@ func retryOrReportThenCleanup(cfg *ymlCfg) int {
}

func retryOrReport() int {
issues := "https://github.com/CoveredCI/testman/issues"
email := "hi@coveredci.co"
issues := "https://github.com/FuzzyMonkeyCo/" + binName + "/issues"
email := "ook@fuzzymonkey.co"
fmt.Println("\nLooks like something went wrong... Maybe try again with -v?")
fmt.Printf("\nYou may want to take a look at %s.log\n", pwdID)
fmt.Printf("or come by %s\n", issues)
Expand Down
20 changes: 10 additions & 10 deletions misc/latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
set -o errexit
set -o nounset

# Installs the latest version of https://github.com/CoveredCI/testman for your system
# Installs the latest version of https://github.com/FuzzyMonkeyCo/monkey for your system

slug=CoveredCI/testman
slug=FuzzyMonkeyCo/monkey

fatal() {
echo "$@"
echo "Please report this at https://github.com/$slug/issues or hi@coveredci.co"
echo "Please report this at https://github.com/$slug/issues or ook@fuzzymonkey.co"
exit 2
}

Expand All @@ -21,12 +21,12 @@ for path in /usr/local/bin /usr/bin ~/.local/bin 'C:\Program Files\Git\usr\bin'
:nil:) fatal "Could not find a suitable target path among $PATH" ;;
*:"$path":*)
mkdir -p "$path" >/dev/null 2>&1 || true
if touch "$path"/testman >/dev/null 2>&1; then
if touch "$path"/monkey >/dev/null 2>&1; then
target_path="$path"
echo "Selected target path: $target_path"
break
else
rm "$path"/testman >/dev/null 2>&1 || true
rm "$path"/monkey >/dev/null 2>&1 || true
fi;;
*) ;;
esac
Expand All @@ -37,7 +37,7 @@ latest_tag_url=$(curl --silent --location --output /dev/null --write-out '%{url_
latest_tag=$(basename "$latest_tag_url")
echo "Latest tag: $latest_tag"

exe="testman-$(uname -s)-$(uname -m)"
exe="monkey-$(uname -s)-$(uname -m)"
case "$exe" in
CYGWIN*|MINGW32*|MSYS*) exe=$exe.exe ;;
esac
Expand All @@ -48,12 +48,12 @@ curl -# --location --output "$tmp".sha256s.txt "https://github.com/$slug/release
curl -# --location --output "$tmp" "https://github.com/$slug/releases/download/$latest_tag/$exe"
cd "$tmp" && sha256sum --check --strict --ignore-missing "$tmp".sha256s.txt && cd -
chmod +x "$tmp"
mv "$tmp" "$target_path"/testman
mv "$tmp" "$target_path"/monkey

if ! which testman >/dev/null 2>&1; then
if ! which monkey >/dev/null 2>&1; then
fatal "$exe does not appear to be in $target_path"
fi
if ! testman --version | grep "$latest_tag" >/dev/null 2>&1; then
fatal "This is not the expected version: $(testman --version || true)"
if ! monkey --version | grep "$latest_tag" >/dev/null 2>&1; then
fatal "This is not the expected version: $(monkey --version || true)"
fi
echo Successful installation!
2 changes: 1 addition & 1 deletion validate_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/go-yaml/yaml"
)

const localYML = ".coveredci.yml"
const localYML = ".fuzzymonkey.yml"

func validateDocs(apiKey string, yml []byte) (rep []byte, err error) {
blobs, err := makeBlobs(yml)
Expand Down
1 change: 1 addition & 0 deletions version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
package main

const binVersion = "0.0.0"
const binVSN = ""

0 comments on commit 6150948

Please sign in to comment.