From ba35f55a48af4aeab3aaa2e09ad8d724c106e71d Mon Sep 17 00:00:00 2001 From: Cory Bennett Date: Sun, 3 Sep 2017 00:40:43 -0700 Subject: [PATCH] fix tests --- .gitignore | 3 +++ jiracmd/worklogList.go | 5 ++++- t/.gnupg/random_seed | Bin 600 -> 0 bytes t/.jira.d/list.yml | 1 + t/100basic.t | 36 +++++++++++++++++++----------------- t/110basic-worklog.t | 8 ++++---- t/200scrum.t | 35 ++++++++++++++++++----------------- t/300kanban.t | 37 +++++++++++++++++++------------------ t/400project.t | 37 +++++++++++++++++++------------------ t/500process.t | 41 ++++++++++++++++++++--------------------- t/600task.t | 41 +++++++++++++++++++++-------------------- 11 files changed, 128 insertions(+), 116 deletions(-) delete mode 100644 t/.gnupg/random_seed create mode 100644 t/.jira.d/list.yml diff --git a/.gitignore b/.gitignore index 21dfae47..5d7fa37b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ +jira schemas/*.json +t/.gnupg/random_seed +t/issue.props diff --git a/jiracmd/worklogList.go b/jiracmd/worklogList.go index bfc4a6a3..f8c60cc6 100644 --- a/jiracmd/worklogList.go +++ b/jiracmd/worklogList.go @@ -5,6 +5,7 @@ import ( "github.com/coryb/oreo" "gopkg.in/Netflix-Skunkworks/go-jira.v1" "gopkg.in/Netflix-Skunkworks/go-jira.v1/jiracli" + "gopkg.in/Netflix-Skunkworks/go-jira.v1/jiradata" kingpin "gopkg.in/alecthomas/kingpin.v2" ) @@ -44,7 +45,9 @@ func CmdWorklogList(o *oreo.Client, globals *jiracli.GlobalOptions, opts *Worklo if err != nil { return err } - if err := jiracli.RunTemplate(opts.Template.Value, data, nil); err != nil { + if err := jiracli.RunTemplate(opts.Template.Value, struct { + Worklogs *jiradata.Worklogs `json:"worklogs,omitempty" yaml:"worklogs,omitempty"` + }{data}, nil); err != nil { return err } if opts.Browse.Value { diff --git a/t/.gnupg/random_seed b/t/.gnupg/random_seed deleted file mode 100644 index 976b1556950e49ef28f6f6975b5073f9c7bc10cc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 600 zcmV-e0;m0FvLMS46WIT#)5Bk+bqj1{vo3nWcYDZ>4ySIjg(%MijyhSRiojatmn<2 zM)>{0b#2Sx^`Ig_j#2+%>!!s&{LP6CQ8+p7jcKC(+@;;VK4$#9P{EbmL|?WnSWGL9$n5jYhG;lU?ge#%dBW9V{tzfFjDX0>$K}aZCHB)ch`atP_vzgB zxdq2Hix>e@XHMR_@9AeyJf1u_h<2hQ&GQG-3frxjNPbPt57K*d0voc!z8v;e7;27^1?X^eL49 diff --git a/t/.jira.d/list.yml b/t/.jira.d/list.yml new file mode 100644 index 00000000..682c0a11 --- /dev/null +++ b/t/.jira.d/list.yml @@ -0,0 +1 @@ +template: list diff --git a/t/100basic.t b/t/100basic.t index 17b31d6e..526c866a 100755 --- a/t/100basic.t +++ b/t/100basic.t @@ -1,9 +1,10 @@ #!/bin/bash eval "$(curl -q -s https://raw.githubusercontent.com/coryb/osht/master/osht.sh)" cd $(dirname $0) -jira="../jira --project BASIC" +jira="../jira" export JIRA_LOG_FORMAT="%{level:-5s} %{message}" +export COLUMNS=149 ENDPOINT="http://localhost:8080" if [ -n "$JIRACLOUD" ]; then ENDPOINT="https://go-jira.atlassian.net" @@ -16,12 +17,12 @@ RUNS $jira logout RUNS $jira login # cleanup from previous failed test executions -($jira ls | awk -F: '{print $1}' | while read issue; do ../jira done $issue; done) | sed 's/^/# CLEANUP: /g' +($jira ls --project BASIC | awk -F: '{print $1}' | while read issue; do ../jira done $issue; done) | sed 's/^/# CLEANUP: /g' ############################################################################### ## Create an issue ############################################################################### -RUNS $jira create -o summary=summary -o description=description --noedit --saveFile issue.props +RUNS $jira create --project BASIC -o summary=summary -o description=description --noedit --saveFile issue.props issue=$(awk '/issue/{print $2}' issue.props) DIFF <