Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding mrgvalidate style Test Id's #251

Merged
merged 12 commits into from
Oct 11, 2021
Merged
11 changes: 6 additions & 5 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ steps:
- # this is a hack around the current design; will clean up after passing a test or two
- go build -o bbi cmd/bbi/main.go
- ./bbi version

- name: Copy commit hashes to s3
commands:
- printf "[\n" > /tmp/${DRONE_BUILD_NUMBER}/commits.json
Expand All @@ -41,7 +40,9 @@ steps:
- export ROOT_EXECUTION_DIR=/data/${DRONE_BUILD_NUMBER}
- export BBI_GRID_NAME_PREFIX="drone_${DRONE_BUILD_NUMBER}"
- bbi init --dir /opt/NONMEM
- go list ./... | grep -v integration | xargs go test
- rm -f /data/${DRONE_BUILD_NUMBER}/test_output.json
- go list ./... | grep -v integration | xargs go test --json | tee /data/${DRONE_BUILD_NUMBER}/test_output.json --append
- aws s3 cp /data/${DRONE_BUILD_NUMBER}/test_output.json s3://mrg-validation/bbi/${DRONE_BUILD_NUMBER}/results.json
environment:
LOCAL: true
MPIEXEC_PATH: /usr/bin/mpiexec
Expand Down Expand Up @@ -72,10 +73,10 @@ steps:
- export ROOT_EXECUTION_DIR=/data/${DRONE_BUILD_NUMBER}
- export BBI_GRID_NAME_PREFIX="drone_${DRONE_BUILD_NUMBER}"
- bbi init --dir /opt/NONMEM
- go test ./... -v --json -timeout 30m | tee test_output.json
- aws s3 cp test_output.json s3://mrg-validation/bbi/${DRONE_BUILD_NUMBER}/results.json
- go test ./... -v --json -timeout 30m | tee /data/${DRONE_BUILD_NUMBER}/test_output.json --append
- aws s3 cp /data/${DRONE_BUILD_NUMBER}/test_output.json s3://mrg-validation/bbi/${DRONE_BUILD_NUMBER}/results.json
- chmod +x failure_detector.sh
- ./failure_detector.sh test_output.json
- ./failure_detector.sh /data/${DRONE_BUILD_NUMBER}/test_output.json
- rm -rf /data/${DRONE_BUILD_NUMBER}
environment:
LOCAL: true
Expand Down
1 change: 1 addition & 0 deletions cmd/clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/gobwas/glob"

"github.com/metrumresearchgroup/bbi/runner"

"github.com/metrumresearchgroup/bbi/utils"

"github.com/spf13/afero"
Expand Down
1 change: 1 addition & 0 deletions cmd/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"os"

"github.com/metrumresearchgroup/bbi/runner"

"github.com/metrumresearchgroup/bbi/utils"

"github.com/metrumresearchgroup/turnstile"
Expand Down
1 change: 1 addition & 0 deletions cmd/nonmem.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/metrumresearchgroup/bbi/configlib"
parser "github.com/metrumresearchgroup/bbi/parsers/nmparser"
"github.com/metrumresearchgroup/bbi/runner"

"github.com/metrumresearchgroup/bbi/utils"

"github.com/metrumresearchgroup/turnstile"
Expand Down
15 changes: 11 additions & 4 deletions cmd/nonmem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"path/filepath"
"testing"

"github.com/metrumresearchgroup/bbi/utils"

"github.com/metrumresearchgroup/bbi/configlib"

"github.com/google/uuid"
Expand Down Expand Up @@ -49,8 +51,10 @@ func Test_doesDirectoryContainOutputFiles(tt *testing.T) {
want: true,
},
}

testId := "UNIT-CMD-001"
for _, test := range tests {
tt.Run(test.name, func(tt *testing.T) {
tt.Run(utils.AddTestId(test.name, testId), func(tt *testing.T) {
t := wrapt.WrapT(tt)

got := doesDirectoryContainOutputFiles(test.args.path, test.args.modelname)
Expand Down Expand Up @@ -152,8 +156,9 @@ func Test_processNMFEOptions(tt *testing.T) {
},
},
}
testId := "UNIT-CMD-002"
for _, test := range tests {
tt.Run(test.name, func(tt *testing.T) {
tt.Run(utils.AddTestId(test.name, testId), func(tt *testing.T) {
t := wrapt.WrapT(tt)

got := processNMFEOptions(test.args.config)
Expand Down Expand Up @@ -198,8 +203,9 @@ func Test_modelDataFile(tt *testing.T) {
wantErr: true,
},
}
testId := "UNIT-CMD-003"
for _, test := range tests {
tt.Run(test.name, func(tt *testing.T) {
tt.Run(utils.AddTestId(test.name, testId), func(tt *testing.T) {
t := wrapt.WrapT(tt)

got, err := modelDataFile(test.args.modelLines)
Expand Down Expand Up @@ -248,8 +254,9 @@ func Test_dataFileIsPresent(tt *testing.T) {
wantErr: true,
},
}
testId := "UNIT-CMD-004"
for _, test := range tests {
tt.Run(test.name, func(tt *testing.T) {
tt.Run(utils.AddTestId(test.name, testId), func(tt *testing.T) {
t := wrapt.WrapT(tt)

err := dataFileIsPresent(test.args.datafile, test.args.modelpath)
Expand Down
1 change: 1 addition & 0 deletions cmd/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"strings"

parser "github.com/metrumresearchgroup/bbi/parsers/nmparser"

"github.com/metrumresearchgroup/bbi/utils"

"github.com/spf13/afero"
Expand Down
6 changes: 5 additions & 1 deletion cmd/sge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package cmd
import (
"testing"

"github.com/metrumresearchgroup/bbi/utils"

"github.com/metrumresearchgroup/bbi/configlib"
)

Expand Down Expand Up @@ -40,8 +42,10 @@ func Test_gridengineJobName(t *testing.T) {
wantErr: false,
},
}

testId := "UNIT-CMD-005"
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Run(utils.AddTestId(tt.name, testId), func(t *testing.T) {
got, err := gridengineJobName(tt.args.model)
if (err != nil) != tt.wantErr {
t.Errorf("gridengineJobName() error = %v, wantErr %v", err, tt.wantErr)
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ require (
github.com/spf13/cobra v1.1.1
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/viper v1.7.1
golang.org/x/tools v0.1.7 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
Expand Down
13 changes: 13 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
Expand Down Expand Up @@ -287,6 +288,8 @@ golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKG
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand All @@ -306,6 +309,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210331212208-0fccb6fa2b5c h1:KHUzaHIpjWVlVVNh65G3hhuj3KB1HnjY6Cq5cTvRQT8=
golang.org/x/net v0.0.0-20210331212208-0fccb6fa2b5c/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d h1:20cMwl2fHAzkJMEA+8J4JgqBQcQGzbisXo31MIeenXI=
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand All @@ -315,6 +320,7 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand All @@ -339,13 +345,18 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44 h1:Bli41pIlzTzf3KEY06n+xnzK/BESIg2ze4Pgfh/aI8c=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e h1:WUoyKPm6nCo1BnNUvPGnFG3T5DUVem42yDJZZ4CNxMA=
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ=
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand All @@ -368,6 +379,8 @@ golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.7 h1:6j8CgantCy3yc8JGBqkDLMKWqZ0RDU2g1HVgacojGWQ=
golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
8 changes: 6 additions & 2 deletions integration/bbi_covcor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"regexp"
"testing"

"github.com/metrumresearchgroup/bbi/utils"

"github.com/metrumresearchgroup/wrapt"
)

Expand All @@ -19,8 +21,9 @@ func TestCovCorHappyPath(tt *testing.T) {
{name: "1001"},
}

testId := "INT-COVCOR-001"
for _, mod := range models {
tt.Run(mod.name, func(tt *testing.T) {
tt.Run(utils.AddTestId(mod.name, testId), func(tt *testing.T) {
t := wrapt.WrapT(tt)

commandAndArgs := []string{
Expand Down Expand Up @@ -58,8 +61,9 @@ func TestCovCorErrors(tt *testing.T) {

rgx := regexp.MustCompile(noFilePresentError)

testId := "INT-COVCOR-002"
for _, mod := range models {
tt.Run(mod.name, func(tt *testing.T) {
tt.Run(utils.AddTestId(mod.name, testId), func(tt *testing.T) {
t := wrapt.WrapT(tt)

commandAndArgs := []string{
Expand Down
Loading