Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for no STDIN but --password-from-stdin option is provided #2081

Open
h-artzi opened this issue Mar 24, 2021 · 0 comments
Open

Add tests for no STDIN but --password-from-stdin option is provided #2081

h-artzi opened this issue Mar 24, 2021 · 0 comments

Comments

@h-artzi
Copy link
Contributor

h-artzi commented Mar 24, 2021

Both conjurctl account create and conjurctl server accept the switch --password-from-stdin. Please add tests that address the scenario that no STDIN is provided but the user provides this option.

The tests would look something like this:

it "no STDIN but `--password-from-stdin` option is present" do
      system("conjurctl account create --name demo --password-from-stdin")
      # Attempt to catch stderr output: `Please provide an input via STDIN`
      expect(Slosilo["authn:demo"]).not_to be
      expect(Role["demo:user:admin"]).not_to be
end

Errors I ran into:

  • output("Please provide an input via STDIN").to_stderr_from_any_process errored out on can't convert Tempfile into StringIO
  • Without attempting to catch the output the command would just hang waiting for STDIN input (in Jenkins), but pass locally.
    I did not attempt to write a cucumber test, but that might be an option to consider as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant