Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Acceptance tests for prm exec common functionality (Backend: Docker) #50

Open
17 tasks
sanfrancrisko opened this issue Dec 8, 2021 · 0 comments
Open
17 tasks

Comments

@sanfrancrisko
Copy link

sanfrancrisko commented Dec 8, 2021

Write acceptance tests to cover the various common parameters in the prm-config.yml

Test setup / techniques:

  • Create an acceptance/exec/testdata dir to hold custom tool configs and point to it during test execution using --toolpath flag
  • Create a temp dir for each target dir and copy in the appropriate resources from acceptance/exec/testdata for each acceptance test

can_validate:

  • With can_validate:true AND a 100% valid validate.yml present in target dir, PRM builds and executes all valid tools against target dir
  • With can_validate:true AND a 50/50 valid/invalid validate.yml present in target dir, PRM builds and executes all valid tools against target dir
  • With can_validate:true AND a 100% invalid validate.yml present in target dir, PRM no-ops with descriptive warning / error message

needs_write_access:

  • With needs_write_access: false, PRM should mount target dir with RO permissions in to tool container
  • With needs_write_access: true, PRM should mount target dir with RW permissions in to tool container

use_script:

  • With valid use_script defined, PRM should build container (if required) and exec this script on tool execution
  • With in use_script defined (i.e. wrong name_), PRM should build container (if required) and return useful error to indicate script not existent
  • With valid use_script defined, but script does not have exec permissions, PRM should build container (if required) and return useful error to indicate script exec permissions not sufficient
  • With valid use_script defined, but script exits with non zero status code, PRM should build container (if required) and return useful error indicating script exec error

requires_git:

  • With requires_git: true defined, PRM should build container (if required) with git app installed
  • With requires_git: false defined, PRM should build container (if required) without git app installed

default_args:

Some potential test techniques:

  • Echo back args passed to app / script

  • Have app drop a file on disk

  • With default_args: [arg1, arg2] defined, PRM should build container and exec tool with the args defined

  • With default_args: [arg1, arg2] defined, and PRM executed with --flags="foo bar", it should build container (if required) and exec tool with the args foo bar

  • With default_args undefined, PRM should build container (if required) and exec tool without any args (e.g. echo back args)

  • With default_args undefined, and PRM executed with --flags="foo bar", it should build container (if required) and exec tool with the args foo bar

help_arg:

  • With help_arg: foo defined, when PRM is executed with prm exec <TOOL> --help, it should invoke the tool with the arg foo
  • With help_arg undefined, when PRM is executed with prm exec <TOOL> --help, it should invoke the tool with the arg --help (default)
@sanfrancrisko sanfrancrisko transferred this issue from puppetlabs/puppet-vscode Dec 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant