Skip to content

Commit

Permalink
Merge pull request #25278 from soltysh/fix_observe
Browse files Browse the repository at this point in the history
Fix oc observe tests
  • Loading branch information
openshift-merge-robot authored Jul 14, 2020
2 parents fa8cf8d + d8980f6 commit 28e888d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions test/extended/testdata/bindata.go

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

8 changes: 4 additions & 4 deletions test/extended/testdata/cmd/test/cmd/observe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ os::cmd::expect_failure_and_text 'oc observe services --once --names echo' '\-\-
os::cmd::expect_success_and_text 'oc observe services --exit-after=1s' 'Shutting down after 1s ...'
os::cmd::expect_success_and_text 'oc observe services --exit-after=1s --all-namespaces --print-metrics-on-exit' 'observe_counts{type="Sync"}'
os::cmd::expect_success_and_text 'oc observe services --once --all-namespaces' 'default kubernetes'
# TODO: fix #31755 and make this a --once test
os::cmd::expect_success_and_text 'oc observe services --exit-after=3s --all-namespaces --names echo --names default/notfound --delete echo --delete remove' 'remove default notfound'
os::cmd::expect_success_and_text 'oc observe services --once --exit-after=3s --all-namespaces --names echo --names default/notfound --delete echo --delete remove' 'remove default notfound'

# error counting
os::cmd::expect_failure_and_text 'oc observe services --exit-after=1m --all-namespaces --maximum-errors=1 -- /bin/sh -c "exit 1"' 'reached maximum error limit of 1, exiting'
Expand All @@ -34,10 +33,11 @@ os::cmd::expect_success_and_text 'oc observe services --once --all-namespaces -a
os::cmd::expect_failure_and_text 'oc observe services --once --all-namespaces -a "bad{ .missingkey }key" --strict-templates' 'missingkey is not found'
os::cmd::expect_success_and_text 'oc observe services --once --all-namespaces -a "{{ .unknown }}" --output=gotemplate' '""'
os::cmd::expect_success_and_text 'oc observe services --once --all-namespaces -a "bad{{ or (.unknown) \"\" }}key" --output=gotemplate' 'badkey'
os::cmd::expect_success_and_text 'oc observe services --once --all-namespaces -a "bad{{ .unknown }}key" --output=gotemplate --strict-templates' '\<no value\>'
# TODO: bring back when oc#472 merges
# os::cmd::expect_success_and_text 'oc observe services --once --all-namespaces -a "bad{{ .unknown }}key" --output=gotemplate --strict-templates' 'map has no entry for key'

# --type-env-var
os::cmd::expect_success_and_text 'MYENV=should_be_passed oc observe services --once --all-namespaces --type-env-var=EVENT -- /bin/sh -c "echo \$EVENT \$MYENV"' 'Sync should_be_passed'

echo "observe: ok"
os::test::junit::declare_suite_end
os::test::junit::declare_suite_end

0 comments on commit 28e888d

Please sign in to comment.