In GoLang, using the == operator to check for a certain error will not
unwrap the error chain, and therefore may hide the problem.
Signed-off-by: Mads Jensen <atombrella@users.noreply.github.com>
Signed-off-by: MrJack <36191829+biagiopietro@users.noreply.github.com>
The test scripts hardcoded #!/bin/bash while they are not really
requiring bash. Use the more portable #!/usr/bin/env sh instead, so that
they use the default shell.
Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
Signed-off-by: MrJack <36191829+biagiopietro@users.noreply.github.com>
Add support for specifying a version constraint when updating plugins,
matching the existing behavior of helm plugin install.
Changes:
- Add --version flag to plugin update command
- Update VCSInstaller.Update() to resolve and checkout specified version
- Update FindSource() to accept version parameter
- Add TestVCSInstallerUpdateWithVersion test for version support
Signed-off-by: MrJack <36191829+biagiopietro@users.noreply.github.com>
Problem: Tests used syscall.Umask(0000) which could leave your shell creating
files with 777 permissions if interrupted.
Solution: Instead of changing umask, tests now detect the current umask and
calculate expected permissions after it's applied.
Result: Same test coverage, but safe from system-wide side effects.
Co-authored-by: Jesse Simpson <jesse.simpson36@gmail.com>
Signed-off-by: Scott Rigby <scott@r6by.com>
Use defer outFile.Close() to avoid multiple close calls and ensure proper resource cleanup
Co-authored-by: Andrew Block <andy.block@gmail.com>
Signed-off-by: Scott Rigby <scott@r6by.com>
* Runtime abstraction to encapsulate subprocess code and enable future runtimes
Also fix race condition in TestPrepareCommandExtraArgs by replacing the shared variable modification with a local copy
Co-authored-by: George Jenkins <gvjenkins@gmail.com>
Signed-off-by: Scott Rigby <scott@r6by.com>
* Remove commented out code
Co-authored-by: Joe Julian <me@joejulian.name>
Signed-off-by: Scott Rigby <scott@r6by.com>
* Check test failure string
Co-authored-by: Jesse Simpson <jesse.simpson36@gmail.com>
Signed-off-by: Scott Rigby <scott@r6by.com>
---------
Signed-off-by: Scott Rigby <scott@r6by.com>
Co-authored-by: George Jenkins <gvjenkins@gmail.com>
Co-authored-by: Joe Julian <me@joejulian.name>
Co-authored-by: Jesse Simpson <jesse.simpson36@gmail.com>