Skip to content

Commit

Permalink
Merge branch 'master' into feature-#20
Browse files Browse the repository at this point in the history
  • Loading branch information
artemnikitin committed Jun 10, 2018
2 parents 78a91b9 + 8c333fe commit e32c4c5
Show file tree
Hide file tree
Showing 1,121 changed files with 21,665 additions and 60,842 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
language: go

go:
- 1.x
- 1.9.x
- 1.8.x

install:
- pwd #just for using vendored dependencies
- go get -u golang.org/x/lint/golint

script:
- go test -race -v $(go list ./... | grep -v /vendor/)
- make

after_success:
- curl --request POST "https://goreportcard.com/checks" --data "repo=github.com/artemnikitin/devicefarm-ci-tool"
32 changes: 32 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"


[[constraint]]
name = "github.com/aws/aws-sdk-go"
version = "1.14.3"

[[constraint]]
name = "github.com/fatih/structs"
version = "1.0.0"
27 changes: 27 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.PHONY: all clean lint test build

all: clean lint test

clean:
@echo "Cleanup..."
rm -f devicefarm-ci-tool_windows_amd64.exe
rm -f devicefarm-ci-tool_darwin_amd64
rm -f devicefarm-ci-tool_linux_arm
rm -f devicefarm-ci-tool_linux_amd64

lint:
@echo "Run checks..."
go fmt $$(go list ./... | grep -v /vendor/)
go vet $$(go list ./... | grep -v /vendor/)
golint $$(go list ./... | grep -v /vendor/)

test:
@echo "Run tests..."
go test -v -race $$(go list ./... | grep -v /vendor/)

build:
@echo "Building binaries..."
GOOS=windows GOARCH=amd64 go build -ldflags "-w -s" -o devicefarm-ci-tool_windows_amd64.exe
GOOS=darwin GOARCH=amd64 go build -ldflags "-w -s" -o devicefarm-ci-tool_darwin_amd64
GOOS=linux GOARCH=arm go build -ldflags "-w -s" -o devicefarm-ci-tool_linux_arm
GOOS=linux GOARCH=amd64 go build -ldflags "-w -s" -o devicefarm-ci-tool_linux_amd64
46 changes: 1 addition & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Example: `-testType INSTRUMENTATION`
#### Configuration file
All parameters in the configuration file are optional. Configuration file is based on a syntax of [ScheduleRun](http://docs.aws.amazon.com/devicefarm/latest/APIReference/API_ScheduleRun.html) request.

Example of config (for current master):
Config example:
```json
{
"name": "string",
Expand Down Expand Up @@ -98,50 +98,6 @@ Example of config (for current master):
}
}
```
Example of old config (for release 1.2.1):
```json
{
"runName":"name",
"devicePoolArn":"ARN",
"devicePoolName":"Top Devices",
"test":{
"type":"BUILTIN_FUZZ|BUILTIN_EXPLORER|APPIUM_JAVA_JUNIT|APPIUM_JAVA_TESTNG|APPIUM_PYTHON|APPIUM_WEB_JAVA_JUNIT|APPIUM_WEB_JAVA_TESTNG|APPIUM_WEB_PYTHON|CALABASH|INSTRUMENTATION|UIAUTOMATION|UIAUTOMATOR|XCTEST",
"testPackageArn":"string",
"testPackagePath":"string",
"filter":"string",
"parameters":{
"key":"value",
"key":"value"
}
},
"additionalData":{
"extraDataPackageArn":"string",
"extraDataPackagePath":"string",
"networkProfileArn":"string",
"locale":"string",
"location":{
"latitude":1.222,
"longitude":1.222
},
"radios":{
"wifi":"true|false",
"bluetooth":"true|false",
"nfc":"true|false",
"gps":"true|false"
},
"auxiliaryApps":[
"string1",
"string2"
],
"billingMethod":"METERED|UNMETERED"
},
"executionConfiguration":{
"jobTimeoutMinutes":111,
"accountsCleanup":false,
"appPackagesCleanup":false
}
}
```


## License
Expand Down
5 changes: 0 additions & 5 deletions build_artifacts.sh

This file was deleted.

44 changes: 0 additions & 44 deletions glide.lock

This file was deleted.

23 changes: 0 additions & 23 deletions glide.yaml

This file was deleted.

12 changes: 10 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"io/ioutil"
"log"
"os"
"strings"

"github.com/artemnikitin/devicefarm-ci-tool/errors"
"github.com/artemnikitin/devicefarm-ci-tool/model"
Expand All @@ -24,6 +25,7 @@ var (
appPath = flag.String("app", "", "Path to an app")
testPath = flag.String("test", "", "Path to test app")
devicePool = flag.String("devices", "Top Devices", "Specify list of devices for tests")
randomDevicePool = flag.String("randomDevices", "", "List of device pools for random choice")
configJSON = flag.String("config", "", "Path to JSON config")
wait = flag.Bool("wait", false, "Wait for run end")
checkEvery = flag.Int("checkEvery", 5, "Specified time slice for checking status of run")
Expand Down Expand Up @@ -92,7 +94,7 @@ func runJob(client devicefarmiface.DeviceFarmAPI, config *model.RunConfig) ([]*m
}
}

if *ignoreUnavailableDevices {
if *ignoreUnavailableDevices && *wait {
pass = svc.IsTestRunPassIgnoringUnavailableDevices(runArn)
}

Expand All @@ -110,7 +112,13 @@ func getConfig() *model.RunConfig {
configFile = model.Transform(bytes)
}
if configFile.DevicePoolArn == "" && configFile.DevicePoolName == "" {
configFile.DevicePoolName = *devicePool
if *randomDevicePool != "" {
pools := strings.Split(*randomDevicePool, ",")
i := tools.Random(0, len(pools)-1)
configFile.DevicePoolName = pools[i]
} else {
configFile.DevicePoolName = *devicePool
}
}
if *runName != "" {
configFile.Name = *runName
Expand Down

0 comments on commit e32c4c5

Please sign in to comment.