inject ssh env vars by apppending them to the script
Some checks failed
ci/woodpecker/push/go-lint Pipeline failed
Some checks failed
ci/woodpecker/push/go-lint Pipeline failed
This commit is contained in:
15
tests/files_test.go
Normal file
15
tests/files_test.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestRunCommandFileTest(t *testing.T) {
|
||||
|
||||
filePath := "packageCommands.yml"
|
||||
cmdLineStr := fmt.Sprintf("go run ../backy.go exec host -c checkDockerNoVersion -m localhost --cmdStdOut -f %s", filePath)
|
||||
|
||||
exec.Command("bash", "-c", cmdLineStr).Output()
|
||||
}
|
||||
@@ -2,6 +2,8 @@ commands:
|
||||
checkDockerNoVersion:
|
||||
type: package
|
||||
shell: zsh
|
||||
environment:
|
||||
- TEST_ENV=production
|
||||
packages:
|
||||
- name: "docker-ce-cli"
|
||||
- name: "docker-ce"
|
||||
|
||||
14
tests/run_tests.sh
Normal file
14
tests/run_tests.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script runs all Go test files in the tests directory.
|
||||
|
||||
echo "Running all tests in the tests directory..."
|
||||
|
||||
go test ./tests/... -v
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "All tests passed successfully."
|
||||
else
|
||||
echo "Some tests failed. Check the output above for details."
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user