Optum / runiac

Run IaC Anywhere With Ease
https://runiac.io
Apache License 2.0
21 stars 19 forks source link

Getting error "exec: 'gotestsum': executable file not found in $PATH" #52

Open naustin opened 2 years ago

naustin commented 2 years ago

I'm experimenting with unit tests in my terraform step, but when I execute Runiac it reports that a test has been found but after the step runs and it tries to execute the test I'm getting the error "exec: 'gotestsum': executable file not found in $PATH".

Here's the log before the error:

Running command: gotestsum --format standard-verbose --junitfile /output/junit/azure-hello-world-default-namespace-primary-centralus.xml --raw-command -- test2json -p azure-hello-world-default-namespace-primary-centralus ./tests.test -test.v.
EnvVars: [TF_VAR_runiac_step, TF_VAR_runiac_region_group, TF_VAR_runiac_target_account_id, TF_VAR_runiac_project, TF_VAR_runiac_region_deploy_type, TF_VAR_runiac_account_id, TF_VAR_runiac_region, TF_VAR_runiac_track, TF_VAR_runiac_primary_region, TF_VAR_runiac_namespace, TF_VAR_runiac_deployment_ring, TF_VAR_runiac_app_version, TF_VAR_runiac_environment]
naustin commented 2 years ago

Here's the configuration from the logs:

Parsed configuration: {
    "RegionalRegions": null,
    "PrimaryRegion": "centralus",
    "DryRun": false,
    "Runner": "terraform",
    "UniqueExternalExecutionID": "",
    "DeploymentRing": "local",
    "SelfDestroy": false,
    "RegionGroup": "",
    "StepWhitelist": null,
    "TargetAll": true,
    "Version": "",
    "MaxRetries": 3,
    "MaxTestRetries": 2,
    "LogLevel": "info",
    "CoreAccounts": null,
    "RegionGroups": null,
    "Namespace": "naustin",
    "Environment": "",
    "Project": "azure-hello-world"
}
Initializing runiac Terraform plugin
Running command: terraform version -no-color
Binary: Terraform v0.15.1
on linux_amd64
tiny-dancer commented 2 years ago

@naustin well done! living on the edge leveraging largely undocumented features, we weren't sure if this feature would be valuable in oss so did not bring it in as a first class item but also did not remove it entirely.

How are your tests configured/written? The way runiac is configured for this feature is it will execute a tests.test executable in the tests directory and assumes golang was used as the test framework (herego using gotestsum for junit compatibility).

RE: the error specifically, if you add gotestsum to your runiac docker container - it should move forward from this error.

tiny-dancer commented 2 years ago

@naustin will close in a few days if no further issues