mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-18 20:23:28 +02:00
add tests for validating changes to auto-generated jiradata files
This commit is contained in:
+5
-2
@@ -5,12 +5,15 @@ before_install:
|
|||||||
language: go
|
language: go
|
||||||
go_import_path: gopkg.in/Netflix-Skunkworks/go-jira.v1
|
go_import_path: gopkg.in/Netflix-Skunkworks/go-jira.v1
|
||||||
go:
|
go:
|
||||||
- 1.8
|
- 1.9
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
- go get -t -v ./...
|
||||||
|
- go test ./...
|
||||||
- make vet
|
- make vet
|
||||||
- make
|
- make
|
||||||
- make prove 2>&1
|
- make prove 2>&1
|
||||||
|
|
||||||
|
|||||||
@@ -571,15 +571,6 @@ func IssueAttachFile(ua HttpClient, endpoint string, issue, filename string, con
|
|||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
if resp.StatusCode == 200 {
|
if resp.StatusCode == 200 {
|
||||||
// FIXME move this to a test, and run go tests as part of our regression
|
|
||||||
if false {
|
|
||||||
// this is because schema is wrong, defaults to type `int`, so we manually change it
|
|
||||||
// to `string`. If the jiradata is regenerated we need to manually make the change
|
|
||||||
// again.
|
|
||||||
log.Debugf("Assert Attachment.ID is a string, rather than int: %v", &jiradata.Attachment{
|
|
||||||
ID: jiradata.IntOrString(0),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
results := jiradata.ListOfAttachment{}
|
results := jiradata.ListOfAttachment{}
|
||||||
return &results, readJSON(resp.Body, &results)
|
return &results, readJSON(resp.Body, &results)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package jiradata
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestAttachmentID(t *testing.T) {
|
||||||
|
// this is because schema is wrong, defaults to type `int`, so we manually change it
|
||||||
|
// to `string`. If the jiradata is regenerated we need to manually make the change
|
||||||
|
// again to include:
|
||||||
|
// ID IntOrString `json:"id,omitempty" yaml:"id,omitempty"`
|
||||||
|
assert.IsType(t, IntOrString(0), Attachment{}.ID)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user