Add e2e patch tests for unauthorized commands #581
Conversation
a2ff776
to
7ae588c
Compare
step "rad patch reject fails (contributer)" | ||
_ <- runTestCommand "rad-key" ["create", "--force"] | ||
rejectOutput <- runTestCommandForError "rad-patch" ["reject", "0"] | ||
assertContains rejectOutput "Are you authorized to do so?" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be less brittle to check for "error"
. Unrelated to this PR, but I note that in error-messages.rad
, some messages are prefixed with error:
, some with Error:
and some not prefixed at all. Maybe this should be made consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I can create another issue for that
test/e2e/Test/E2ESupport.hs
Outdated
-- | Like 'runTestCommand'' but expects the command to return an error. | ||
-- | ||
-- If the command exits with a non-zero exit code, an exception is thrown. | ||
-- Otherwise stdout of the error is returned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- Otherwise stdout of the error is returned. | |
-- Otherwise stdout of the command is returned. |
test/e2e/Test/E2ESupport.hs
Outdated
let commandLine = bin <> " " <> unwords argsString | ||
in liftIO $ HUnit.assertFailure $ | ||
"Command " <> commandLine <> " succeeded,\n" | ||
<> "but was expected to fail." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think printing stdout
and stderr
would be helpful here, too.
No description provided.