fix tests

This commit is contained in:
Cory Bennett
2017-09-03 00:40:43 -07:00
parent dc021818bb
commit ba35f55a48
11 changed files with 128 additions and 116 deletions
+3
View File
@@ -1 +1,4 @@
jira
schemas/*.json
t/.gnupg/random_seed
t/issue.props
+4 -1
View File
@@ -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 {
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
template: list
+19 -17
View File
@@ -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 <<EOF
@@ -52,7 +53,7 @@ EOF
## List all issues, should be just the one we created
###############################################################################
RUNS $jira ls
RUNS $jira ls --project BASIC
DIFF <<EOF
$(printf %-12s $issue:) summary
EOF
@@ -61,7 +62,7 @@ EOF
## List all issues, using the table template
###############################################################################
RUNS $jira ls --template table
RUNS $jira ls --project BASIC --template table
DIFF <<EOF
+----------------+---------------------------------------------------------+--------------+--------------+------------+--------------+--------------+
| Issue | Summary | Priority | Status | Age | Reporter | Assignee |
@@ -76,7 +77,7 @@ EOF
NRUNS $jira close $issue
EDIFF <<EOF
ERROR Invalid Transition 'close', Available: To Do, In Progress, In Review, Done
ERROR Invalid Transition "close" from "To Do", Available: To Do, In Progress, In Review, Done
EOF
###############################################################################
@@ -92,7 +93,7 @@ EOF
## Verify there are no unresolved issues
###############################################################################
RUNS $jira ls
RUNS $jira ls --project BASIC
DIFF <<EOF
EOF
@@ -100,13 +101,13 @@ EOF
## Setup 2 more issues so we can test duping
###############################################################################
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 <<EOF
OK $issue $ENDPOINT/browse/$issue
EOF
RUNS $jira create -o summary=dup -o description=dup --noedit --saveFile issue.props
RUNS $jira create --project BASIC -o summary=dup -o description=dup --noedit --saveFile issue.props
dup=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
OK $dup $ENDPOINT/browse/$dup
@@ -118,7 +119,7 @@ EOF
## that issue should be resolved
###############################################################################
RUNS $jira $dup dups $issue --noedit
RUNS $jira dup $dup $issue
DIFF <<EOF
OK $issue $ENDPOINT/browse/$issue
OK $dup $ENDPOINT/browse/$dup
@@ -146,7 +147,7 @@ EOF
## We should see only one unresolved issue, the Dup should be resolved
###############################################################################
RUNS $jira ls
RUNS $jira ls --project BASIC
DIFF <<EOF
$(printf %-12s $issue:) summary
EOF
@@ -155,7 +156,7 @@ EOF
## Setup for testing blocking issues
###############################################################################
RUNS $jira create -o summary=blocks -o description=blocks --noedit --saveFile issue.props
RUNS $jira create --project BASIC -o summary=blocks -o description=blocks --noedit --saveFile issue.props
blocker=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
@@ -165,9 +166,10 @@ EOF
## Set blocker and verify it shows up when viewing the main issue
###############################################################################
RUNS $jira $blocker blocks $issue
RUNS $jira block $blocker $issue
DIFF <<EOF
OK $issue $ENDPOINT/browse/$issue
OK $blocker $ENDPOINT/browse/$blocker
EOF
RUNS $jira $issue
@@ -192,7 +194,7 @@ EOF
## Both issues are unresolved now
###############################################################################
RUNS $jira ls
RUNS $jira ls --project BASIC
DIFF <<EOF
$(printf %-12s $issue:) summary
$(printf %-12s $blocker:) blocks
@@ -389,7 +391,7 @@ EOF
## Verify we can add labels to an issue
###############################################################################
RUNS $jira add labels $blocker test-label another-label
RUNS $jira labels add $blocker test-label another-label
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
EOF
@@ -417,7 +419,7 @@ EOF
## Verify we can remove a label
###############################################################################
RUNS $jira remove labels $blocker another-label
RUNS $jira labels remove $blocker another-label
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
EOF
@@ -445,7 +447,7 @@ EOF
## Verify we can replace the labels with a new set
###############################################################################
RUNS $jira set labels $blocker more-label better-label
RUNS $jira labels set $blocker more-label better-label
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
EOF
+4 -4
View File
@@ -1,7 +1,7 @@
#!/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}"
ENDPOINT="http://localhost:8080"
@@ -16,12 +16,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 <<EOF
@@ -31,7 +31,7 @@ EOF
###############################################################################
## Add a worklog to an issue
###############################################################################
RUNS $jira add worklog $issue --comment "work is hard" --time-spent "1h 12m" --noedit
RUNS $jira worklog add $issue --comment "work is hard" --time-spent "1h 12m" --noedit
DIFF <<EOF
OK $issue $ENDPOINT/browse/$issue
EOF
+18 -17
View File
@@ -1,7 +1,7 @@
#!/bin/bash
eval "$(curl -q -s https://raw.githubusercontent.com/coryb/osht/master/osht.sh)"
cd $(dirname $0)
jira="../jira --project SCRUM"
jira="../jira"
export JIRA_LOG_FORMAT="%{level:-5s} %{message}"
ENDPOINT="http://localhost:8080"
@@ -12,7 +12,7 @@ fi
PLAN 84
# 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 SCRUM | awk -F: '{print $1}' | while read issue; do ../jira done $issue; done) | sed 's/^/# CLEANUP: /g'
# reset login
RUNS $jira logout
@@ -21,7 +21,7 @@ echo "gojira123" | RUNS $jira login
###############################################################################
## Create an issue
###############################################################################
RUNS $jira create -o summary=summary -o description=description --noedit --saveFile issue.props
RUNS $jira create --project SCRUM -o summary=summary -o description=description --noedit --saveFile issue.props
issue=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
@@ -52,7 +52,7 @@ EOF
## List all issues, should be just the one we created
###############################################################################
RUNS $jira ls
RUNS $jira ls --project SCRUM
DIFF <<EOF
$(printf %-12s $issue:) summary
EOF
@@ -63,7 +63,7 @@ EOF
NRUNS $jira close $issue
EDIFF <<EOF
ERROR Invalid Transition 'close', Available: To Do, In Progress, Done
ERROR Invalid Transition "close" from "To Do", Available: To Do, In Progress, Done
EOF
###############################################################################
@@ -79,7 +79,7 @@ EOF
## Verify there are no unresolved issues
###############################################################################
RUNS $jira ls
RUNS $jira ls --project SCRUM
DIFF <<EOF
EOF
@@ -87,13 +87,13 @@ EOF
## Setup 2 more issues so we can test duping
###############################################################################
RUNS $jira create -o summary=summary -o description=description --noedit --saveFile issue.props
RUNS $jira create --project SCRUM -o summary=summary -o description=description --noedit --saveFile issue.props
issue=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
OK $issue $ENDPOINT/browse/$issue
EOF
RUNS $jira create -o summary=dup -o description=dup --noedit --saveFile issue.props
RUNS $jira create --project SCRUM -o summary=dup -o description=dup --noedit --saveFile issue.props
dup=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
OK $dup $ENDPOINT/browse/$dup
@@ -105,7 +105,7 @@ EOF
## that issue should be resolved
###############################################################################
RUNS $jira $dup dups $issue --noedit
RUNS $jira dup $dup $issue
DIFF <<EOF
OK $issue $ENDPOINT/browse/$issue
OK $dup $ENDPOINT/browse/$dup
@@ -133,7 +133,7 @@ EOF
## We should see only one unresolved issue, the Dup should be resolved
###############################################################################
RUNS $jira ls
RUNS $jira ls --project SCRUM
DIFF <<EOF
$(printf %-12s $issue:) summary
EOF
@@ -142,7 +142,7 @@ EOF
## Setup for testing blocking issues
###############################################################################
RUNS $jira create -o summary=blocks -o description=blocks --noedit --saveFile issue.props
RUNS $jira create --project SCRUM -o summary=blocks -o description=blocks --noedit --saveFile issue.props
blocker=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
@@ -152,9 +152,10 @@ EOF
## Set blocker and verify it shows up when viewing the main issue
###############################################################################
RUNS $jira $blocker blocks $issue
RUNS $jira block $blocker $issue
DIFF <<EOF
OK $issue $ENDPOINT/browse/$issue
OK $blocker $ENDPOINT/browse/$blocker
EOF
RUNS $jira $issue
@@ -179,7 +180,7 @@ EOF
## Both issues are unresolved now
###############################################################################
RUNS $jira ls
RUNS $jira ls --project SCRUM
DIFF <<EOF
$(printf %-12s $issue:) summary
$(printf %-12s $blocker:) blocks
@@ -288,7 +289,7 @@ EOF
NRUNS $jira trans "review" $blocker --noedit
DIFF <<EOF
ERROR Invalid Transition 'review', Available: To Do, In Progress, Done
ERROR Invalid Transition "review" from "To Do", Available: To Do, In Progress, Done
EOF
###############################################################################
@@ -376,7 +377,7 @@ EOF
## Verify we can add labels to an issue
###############################################################################
RUNS $jira add labels $blocker test-label another-label
RUNS $jira labels add $blocker test-label another-label
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
EOF
@@ -404,7 +405,7 @@ EOF
## Verify we can remove a label
###############################################################################
RUNS $jira remove labels $blocker another-label
RUNS $jira labels remove $blocker another-label
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
EOF
@@ -432,7 +433,7 @@ EOF
## Verify we can replace the labels with a new set
###############################################################################
RUNS $jira set labels $blocker more-label better-label
RUNS $jira labels set $blocker more-label better-label
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
EOF
+19 -18
View File
@@ -1,7 +1,7 @@
#!/bin/bash
eval "$(curl -q -s https://raw.githubusercontent.com/coryb/osht/master/osht.sh)"
cd $(dirname $0)
jira="../jira --project KANBAN"
jira="../jira"
export JIRA_LOG_FORMAT="%{level:-5s} %{message}"
ENDPOINT="http://localhost:8080"
@@ -12,7 +12,7 @@ fi
PLAN 86
# 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 KANBAN | awk -F: '{print $1}' | while read issue; do ../jira done $issue; done) | sed 's/^/# CLEANUP: /g'
# reset login
RUNS $jira logout
@@ -21,7 +21,7 @@ echo "gojira123" | RUNS $jira login
###############################################################################
## Create an issue
###############################################################################
RUNS $jira create -o summary=summary -o description=description --noedit --saveFile issue.props
RUNS $jira create --project KANBAN -o summary=summary -o description=description --noedit --saveFile issue.props
issue=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
@@ -52,7 +52,7 @@ EOF
## List all issues, should be just the one we created
###############################################################################
RUNS $jira ls
RUNS $jira ls --project KANBAN
DIFF <<EOF
$(printf %-12s $issue:) summary
EOF
@@ -63,7 +63,7 @@ EOF
NRUNS $jira close $issue
EDIFF <<EOF
ERROR Invalid Transition 'close', Available: Backlog, Selected for Development, In Progress, Done
ERROR Invalid Transition "close" from "Backlog", Available: Backlog, Selected for Development, In Progress, Done
EOF
###############################################################################
@@ -79,7 +79,7 @@ EOF
## Verify there are no unresolved issues
###############################################################################
RUNS $jira ls
RUNS $jira ls --project KANBAN
DIFF <<EOF
EOF
@@ -87,13 +87,13 @@ EOF
## Setup 2 more issues so we can test duping
###############################################################################
RUNS $jira create -o summary=summary -o description=description --noedit --saveFile issue.props
RUNS $jira create --project KANBAN -o summary=summary -o description=description --noedit --saveFile issue.props
issue=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
OK $issue $ENDPOINT/browse/$issue
EOF
RUNS $jira create -o summary=dup -o description=dup --noedit --saveFile issue.props
RUNS $jira create --project KANBAN -o summary=dup -o description=dup --noedit --saveFile issue.props
dup=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
OK $dup $ENDPOINT/browse/$dup
@@ -105,7 +105,7 @@ EOF
## that issue should be resolved
###############################################################################
RUNS $jira $dup dups $issue --noedit
RUNS $jira dup $dup $issue
DIFF <<EOF
OK $issue $ENDPOINT/browse/$issue
OK $dup $ENDPOINT/browse/$dup
@@ -133,7 +133,7 @@ EOF
## We should see only one unresolved issue, the Dup should be resolved
###############################################################################
RUNS $jira ls
RUNS $jira ls --project KANBAN
DIFF <<EOF
$(printf %-12s $issue:) summary
EOF
@@ -142,7 +142,7 @@ EOF
## Setup for testing blocking issues
###############################################################################
RUNS $jira create -o summary=blocks -o description=blocks --noedit --saveFile issue.props
RUNS $jira create --project KANBAN -o summary=blocks -o description=blocks --noedit --saveFile issue.props
blocker=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
@@ -152,9 +152,10 @@ EOF
## Set blocker and verify it shows up when viewing the main issue
###############################################################################
RUNS $jira $blocker blocks $issue
RUNS $jira block $blocker $issue
DIFF <<EOF
OK $issue $ENDPOINT/browse/$issue
OK $blocker $ENDPOINT/browse/$blocker
EOF
RUNS $jira $issue
@@ -179,7 +180,7 @@ EOF
## Both issues are unresolved now
###############################################################################
RUNS $jira ls
RUNS $jira ls --project KANBAN
DIFF <<EOF
$(printf %-12s $issue:) summary
$(printf %-12s $blocker:) blocks
@@ -279,7 +280,7 @@ EOF
NRUNS $jira todo $blocker
DIFF <<EOF
ERROR Invalid Transition 'To Do', Available: Backlog, Selected for Development, In Progress, Done
ERROR Invalid Transition "To Do" from "In Progress", Available: Backlog, Selected for Development, In Progress, Done
EOF
###############################################################################
@@ -297,7 +298,7 @@ EOF
NRUNS $jira trans "review" $blocker --noedit
DIFF <<EOF
ERROR Invalid Transition 'review', Available: Backlog, Selected for Development, In Progress, Done
ERROR Invalid Transition "review" from "Backlog", Available: Backlog, Selected for Development, In Progress, Done
EOF
###############################################################################
@@ -385,7 +386,7 @@ EOF
## Verify we can add labels to an issue
###############################################################################
RUNS $jira add labels $blocker test-label another-label
RUNS $jira labels add $blocker test-label another-label
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
EOF
@@ -413,7 +414,7 @@ EOF
## Verify we can remove a label
###############################################################################
RUNS $jira remove labels $blocker another-label
RUNS $jira labels remove $blocker another-label
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
EOF
@@ -441,7 +442,7 @@ EOF
## Verify we can replace the labels with a new set
###############################################################################
RUNS $jira set labels $blocker more-label better-label
RUNS $jira labels set $blocker more-label better-label
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
EOF
+19 -18
View File
@@ -1,7 +1,7 @@
#!/bin/bash
eval "$(curl -q -s https://raw.githubusercontent.com/coryb/osht/master/osht.sh)"
cd $(dirname $0)
jira="../jira --project PROJECT"
jira="../jira"
export JIRA_LOG_FORMAT="%{level:-5s} %{message}"
ENDPOINT="http://localhost:8080"
@@ -12,7 +12,7 @@ fi
PLAN 84
# 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 PROJECT | awk -F: '{print $1}' | while read issue; do ../jira done $issue; done) | sed 's/^/# CLEANUP: /g'
# reset login
RUNS $jira logout
@@ -21,7 +21,7 @@ echo "gojira123" | RUNS $jira login
###############################################################################
## Create an issue
###############################################################################
RUNS $jira create -o summary=summary -o description=description --noedit --saveFile issue.props
RUNS $jira create --project PROJECT -o summary=summary -o description=description --noedit --saveFile issue.props
issue=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
@@ -52,7 +52,7 @@ EOF
## List all issues, should be just the one we created
###############################################################################
RUNS $jira ls
RUNS $jira ls --project PROJECT
DIFF <<EOF
$(printf %-12s $issue:) summary
EOF
@@ -63,7 +63,7 @@ EOF
NRUNS $jira close $issue
EDIFF <<EOF
ERROR Invalid Transition 'close', Available: Start Progress, Done
ERROR Invalid Transition "close" from "To Do", Available: Start Progress, Done
EOF
###############################################################################
@@ -79,7 +79,7 @@ EOF
## Verify there are no unresolved issues
###############################################################################
RUNS $jira ls
RUNS $jira ls --project PROJECT
DIFF <<EOF
EOF
@@ -87,13 +87,13 @@ EOF
## Setup 2 more issues so we can test duping
###############################################################################
RUNS $jira create -o summary=summary -o description=description --noedit --saveFile issue.props
RUNS $jira create --project PROJECT -o summary=summary -o description=description --noedit --saveFile issue.props
issue=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
OK $issue $ENDPOINT/browse/$issue
EOF
RUNS $jira create -o summary=dup -o description=dup --noedit --saveFile issue.props
RUNS $jira create --project PROJECT -o summary=dup -o description=dup --noedit --saveFile issue.props
dup=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
OK $dup $ENDPOINT/browse/$dup
@@ -105,7 +105,7 @@ EOF
## that issue should be resolved
###############################################################################
RUNS $jira $dup dups $issue --noedit
RUNS $jira dup $dup $issue
DIFF <<EOF
OK $issue $ENDPOINT/browse/$issue
OK $dup $ENDPOINT/browse/$dup
@@ -133,7 +133,7 @@ EOF
## We should see only one unresolved issue, the Dup should be resolved
###############################################################################
RUNS $jira ls
RUNS $jira ls --project PROJECT
DIFF <<EOF
$(printf %-12s $issue:) summary
EOF
@@ -142,7 +142,7 @@ EOF
## Setup for testing blocking issues
###############################################################################
RUNS $jira create -o summary=blocks -o description=blocks --noedit --saveFile issue.props
RUNS $jira create --project PROJECT -o summary=blocks -o description=blocks --noedit --saveFile issue.props
blocker=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
@@ -152,9 +152,10 @@ EOF
## Set blocker and verify it shows up when viewing the main issue
###############################################################################
RUNS $jira $blocker blocks $issue
RUNS $jira block $blocker $issue
DIFF <<EOF
OK $issue $ENDPOINT/browse/$issue
OK $blocker $ENDPOINT/browse/$blocker
EOF
RUNS $jira $issue
@@ -179,7 +180,7 @@ EOF
## Both issues are unresolved now
###############################################################################
RUNS $jira ls
RUNS $jira ls --project PROJECT
DIFF <<EOF
$(printf %-12s $issue:) summary
$(printf %-12s $blocker:) blocks
@@ -270,7 +271,7 @@ EOF
NRUNS $jira trans "In Progress" $blocker --noedit
DIFF <<EOF
ERROR Invalid Transition 'In Progress', Available: Start Progress, Done
ERROR Invalid Transition "In Progress" from "To Do", Available: Start Progress, Done
EOF
@@ -280,7 +281,7 @@ EOF
NRUNS $jira trans "review" $blocker --noedit
DIFF <<EOF
ERROR Invalid Transition 'review', Available: Start Progress, Done
ERROR Invalid Transition "review" from "To Do", Available: Start Progress, Done
EOF
###############################################################################
@@ -387,7 +388,7 @@ EOF
## Verify we can add labels to an issue
###############################################################################
RUNS $jira add labels $blocker test-label another-label
RUNS $jira labels add $blocker test-label another-label
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
EOF
@@ -415,7 +416,7 @@ EOF
## Verify we can remove a label
###############################################################################
RUNS $jira remove labels $blocker another-label
RUNS $jira labels remove $blocker another-label
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
EOF
@@ -443,7 +444,7 @@ EOF
## Verify we can replace the labels with a new set
###############################################################################
RUNS $jira set labels $blocker more-label better-label
RUNS $jira labels set $blocker more-label better-label
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
EOF
+20 -21
View File
@@ -1,7 +1,7 @@
#!/bin/bash
eval "$(curl -q -s https://raw.githubusercontent.com/coryb/osht/master/osht.sh)"
cd $(dirname $0)
jira="../jira --project PROCESS"
jira="../jira"
export JIRA_LOG_FORMAT="%{level:-5s} %{message}"
ENDPOINT="http://localhost:8080"
@@ -12,8 +12,8 @@ fi
PLAN 84
# cleanup from previous failed test executions
($jira ls | awk -F: '{print $1}' | while read issue; do ../jira start $issue; done) | sed 's/^/# CLEANUP: /g'
($jira ls | awk -F: '{print $1}' | while read issue; do ../jira stop $issue; done) | sed 's/^/# CLEANUP: /g'
($jira ls --project PROCESS | awk -F: '{print $1}' | while read issue; do ../jira start $issue; done) | sed 's/^/# CLEANUP: /g'
($jira ls --project PROCESS | awk -F: '{print $1}' | while read issue; do ../jira stop $issue; done) | sed 's/^/# CLEANUP: /g'
# reset login
RUNS $jira logout
@@ -22,7 +22,7 @@ echo "gojira123" | RUNS $jira login
###############################################################################
## Create an issue
###############################################################################
RUNS $jira create -o summary=summary -o description=description --noedit --saveFile issue.props
RUNS $jira create --project PROCESS -o summary=summary -o description=description --noedit --saveFile issue.props
issue=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
@@ -53,7 +53,7 @@ EOF
## List all issues, should be just the one we created
###############################################################################
RUNS $jira ls
RUNS $jira ls --project PROCESS
DIFF <<EOF
$(printf %-12s $issue:) summary
EOF
@@ -64,7 +64,7 @@ EOF
NRUNS $jira close $issue
EDIFF <<EOF
ERROR Invalid Transition 'close', Available: Start Progress
ERROR Invalid Transition "close" from "Open", Available: Start Progress
EOF
###############################################################################
@@ -87,7 +87,7 @@ EOF
## Verify there are no unresolved issues
###############################################################################
RUNS $jira ls
RUNS $jira ls --project PROCESS
DIFF <<EOF
EOF
@@ -95,13 +95,13 @@ EOF
## Setup 2 more issues so we can test duping
###############################################################################
RUNS $jira create -o summary=summary -o description=description --noedit --saveFile issue.props
RUNS $jira create --project PROCESS -o summary=summary -o description=description --noedit --saveFile issue.props
issue=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
OK $issue $ENDPOINT/browse/$issue
EOF
RUNS $jira create -o summary=dup -o description=dup --noedit --saveFile issue.props
RUNS $jira create --project PROCESS -o summary=dup -o description=dup --noedit --saveFile issue.props
dup=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
OK $dup $ENDPOINT/browse/$dup
@@ -114,12 +114,10 @@ EOF
## 2 steps to resolve, one is "Start Progress" then resolved with "Stop
## Progress", so we see 3 updates in total
###############################################################################
RUNS $jira $dup dups $issue --noedit
RUNS $jira dup $dup $issue
DIFF <<EOF
OK $issue $ENDPOINT/browse/$issue
OK $dup $ENDPOINT/browse/$dup
OK $dup $ENDPOINT/browse/$dup
EOF
RUNS $jira $issue
@@ -144,7 +142,7 @@ EOF
## We should see only one unresolved issue, the Dup should be resolved
###############################################################################
RUNS $jira ls
RUNS $jira ls --project PROCESS
DIFF <<EOF
$(printf %-12s $issue:) summary
EOF
@@ -153,7 +151,7 @@ EOF
## Setup for testing blocking issues
###############################################################################
RUNS $jira create -o summary=blocks -o description=blocks --noedit --saveFile issue.props
RUNS $jira create --project PROCESS -o summary=blocks -o description=blocks --noedit --saveFile issue.props
blocker=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
@@ -163,9 +161,10 @@ EOF
## Set blocker and verify it shows up when viewing the main issue
###############################################################################
RUNS $jira $blocker blocks $issue
RUNS $jira block $blocker $issue
DIFF <<EOF
OK $issue $ENDPOINT/browse/$issue
OK $blocker $ENDPOINT/browse/$blocker
EOF
RUNS $jira $issue
@@ -190,7 +189,7 @@ EOF
## Both issues are unresolved now
###############################################################################
RUNS $jira ls
RUNS $jira ls --project PROCESS
DIFF <<EOF
$(printf %-12s $issue:) summary
$(printf %-12s $blocker:) blocks
@@ -281,7 +280,7 @@ EOF
NRUNS $jira trans "In Progress" $blocker --noedit
DIFF <<EOF
ERROR Invalid Transition 'In Progress', Available: Start Progress
ERROR Invalid Transition "In Progress" from "Open", Available: Start Progress
EOF
@@ -291,7 +290,7 @@ EOF
NRUNS $jira trans "review" $blocker --noedit
DIFF <<EOF
ERROR Invalid Transition 'review', Available: Start Progress
ERROR Invalid Transition "review" from "Open", Available: Start Progress
EOF
###############################################################################
@@ -380,7 +379,7 @@ EOF
## Verify we can add labels to an issue
###############################################################################
RUNS $jira add labels $blocker test-label another-label
RUNS $jira labels add $blocker test-label another-label
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
EOF
@@ -408,7 +407,7 @@ EOF
## Verify we can remove a label
###############################################################################
RUNS $jira remove labels $blocker another-label
RUNS $jira labels remove $blocker another-label
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
EOF
@@ -436,7 +435,7 @@ EOF
## Verify we can replace the labels with a new set
###############################################################################
RUNS $jira set labels $blocker more-label better-label
RUNS $jira labels set $blocker more-label better-label
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
EOF
+21 -20
View File
@@ -1,7 +1,7 @@
#!/bin/bash
eval "$(curl -q -s https://raw.githubusercontent.com/coryb/osht/master/osht.sh)"
cd $(dirname $0)
jira="../jira --project TASK"
jira="../jira"
export JIRA_LOG_FORMAT="%{level:-5s} %{message}"
ENDPOINT="http://localhost:8080"
@@ -12,7 +12,7 @@ fi
PLAN 82
# 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 TASK | awk -F: '{print $1}' | while read issue; do ../jira done $issue; done) | sed 's/^/# CLEANUP: /g'
# reset login
RUNS $jira logout
@@ -21,7 +21,7 @@ echo "gojira123" | RUNS $jira login
###############################################################################
## Create an issue
###############################################################################
RUNS $jira create -o summary=summary -o description=description --noedit --saveFile issue.props
RUNS $jira create --project TASK -o summary=summary -o description=description --noedit --saveFile issue.props
issue=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
@@ -52,7 +52,7 @@ EOF
## List all issues, should be just the one we created
###############################################################################
RUNS $jira ls
RUNS $jira ls --project TASK
DIFF <<EOF
$(printf %-12s $issue:) summary
EOF
@@ -63,7 +63,7 @@ EOF
NRUNS $jira close $issue
EDIFF <<EOF
ERROR Invalid Transition 'close', Available: Done
ERROR Invalid Transition "close" from "To Do", Available: Done
EOF
###############################################################################
@@ -79,7 +79,7 @@ EOF
## Verify there are no unresolved issues
###############################################################################
RUNS $jira ls
RUNS $jira ls --project TASK
DIFF <<EOF
EOF
@@ -87,13 +87,13 @@ EOF
## Setup 2 more issues so we can test duping
###############################################################################
RUNS $jira create -o summary=summary -o description=description --noedit --saveFile issue.props
RUNS $jira create --project TASK -o summary=summary -o description=description --noedit --saveFile issue.props
issue=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
OK $issue $ENDPOINT/browse/$issue
EOF
RUNS $jira create -o summary=dup -o description=dup --noedit --saveFile issue.props
RUNS $jira create --project TASK -o summary=dup -o description=dup --noedit --saveFile issue.props
dup=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
OK $dup $ENDPOINT/browse/$dup
@@ -107,7 +107,7 @@ EOF
## Progress", so we see 3 updates in total
###############################################################################
RUNS $jira $dup dups $issue --noedit
RUNS $jira dup $dup $issue
DIFF <<EOF
OK $issue $ENDPOINT/browse/$issue
OK $dup $ENDPOINT/browse/$dup
@@ -135,7 +135,7 @@ EOF
## We should see only one unresolved issue, the Dup should be resolved
###############################################################################
RUNS $jira ls
RUNS $jira ls --project TASK
DIFF <<EOF
$(printf %-12s $issue:) summary
EOF
@@ -144,7 +144,7 @@ EOF
## Setup for testing blocking issues
###############################################################################
RUNS $jira create -o summary=blocks -o description=blocks --noedit --saveFile issue.props
RUNS $jira create --project TASK -o summary=blocks -o description=blocks --noedit --saveFile issue.props
blocker=$(awk '/issue/{print $2}' issue.props)
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
@@ -154,9 +154,10 @@ EOF
## Set blocker and verify it shows up when viewing the main issue
###############################################################################
RUNS $jira $blocker blocks $issue
RUNS $jira block $blocker $issue
DIFF <<EOF
OK $issue $ENDPOINT/browse/$issue
OK $blocker $ENDPOINT/browse/$blocker
EOF
RUNS $jira $issue
@@ -181,7 +182,7 @@ EOF
## Both issues are unresolved now
###############################################################################
RUNS $jira ls
RUNS $jira ls --project TASK
DIFF <<EOF
$(printf %-12s $issue:) summary
$(printf %-12s $blocker:) blocks
@@ -272,7 +273,7 @@ EOF
NRUNS $jira trans "In Progress" $blocker --noedit
DIFF <<EOF
ERROR Invalid Transition 'In Progress', Available: Done
ERROR Invalid Transition "In Progress" from "To Do", Available: Done
EOF
@@ -282,7 +283,7 @@ EOF
NRUNS $jira trans "review" $blocker --noedit
DIFF <<EOF
ERROR Invalid Transition 'review', Available: Done
ERROR Invalid Transition "review" from "To Do", Available: Done
EOF
###############################################################################
@@ -291,7 +292,7 @@ EOF
NRUNS $jira start $blocker
DIFF <<EOF
ERROR Invalid Transition 'start', Available: Done
ERROR Invalid Transition "start" from "To Do", Available: Done
EOF
###############################################################################
@@ -300,7 +301,7 @@ EOF
NRUNS $jira stop $blocker
DIFF <<EOF
ERROR Invalid Transition 'stop', Available: Done
ERROR Invalid Transition "stop" from "To Do", Available: Done
EOF
@@ -371,7 +372,7 @@ EOF
## Verify we can add labels to an issue
###############################################################################
RUNS $jira add labels $blocker test-label another-label
RUNS $jira labels add $blocker test-label another-label
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
EOF
@@ -399,7 +400,7 @@ EOF
## Verify we can remove a label
###############################################################################
RUNS $jira remove labels $blocker another-label
RUNS $jira labels remove $blocker another-label
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
EOF
@@ -427,7 +428,7 @@ EOF
## Verify we can replace the labels with a new set
###############################################################################
RUNS $jira set labels $blocker more-label better-label
RUNS $jira labels set $blocker more-label better-label
DIFF <<EOF
OK $blocker $ENDPOINT/browse/$blocker
EOF