-
Notifications
You must be signed in to change notification settings - Fork 18
Conversation
This is ready to merge. |
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.
Really like the direction here. Looks like a good start for an integration testing framework.
} | ||
|
||
// HostRunner executes command tests on the host, outside of a container | ||
type HostRunner struct{} |
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.
Do you foresee us using HostRunner
in the coder-cli tests?
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.
Not at the moment, but I do think it has a place in tcli
as an escape hatch.
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.
Previous comments were very minor.
Progress towards #63 https://github.com/cdr/enterprise/issues/4230
This PR introduces a new CLI testing framework modeled after https://github.com/cdr/hat.
The tentative name is
tcli
. Commands are executed inside docker containers to limit pollution of the host filesystem and to promote reproducibility.tcli
uses a flexible and extensibleAssertion
API for asserting properties about theCommandResult
.View a sample usage of
tcli
hereGiven that
coder login
currently requires a browser, this PR uses a workaround approach by which asession_token
is acquired through a manual call to the/auth/basic/login
endpoint. The test then injects the credentials into their respective configuration files within the given container manually.