Basically, I am trying to export the coverage directory generated after a test run form the container to the host. The command I am using to call the test function is :
_EXPERIMENTAL_DAGGER_RUNNER_HOST="docker-container://dagger-engine-custom" dagger call -m $1 test --githubToken=$GITHUB_TOKEN --source=. export --path=./dagger/output
Where $1 refers to a hash of the latest commit. I need to pass in the GitHub Token and source params to my method:
/**
* Return the result of running unit tests
*/
@func()
async test(
@argument({ ignore: ['**/node_modules', 'node_modules', '.git'] }) source: Directory,
githubToken: string,
): Directory {
return this.buildEnv(source, githubToken)
.withExec(['npm', 'run', 'test:dagger', '--', '--coverage', '--json', `--outputFile=/app/report-test.json`])
.directory('/app');
}
I have seen a similar issue posted before and I tried the fix in that but it didn't work. I checked that the method is returning a directory based on that suggestion but still get the following error:
✔ connect 0.6s
✔ load module 2.2s
✘ parsing command line arguments 1.4s
! unknown command "export" for "dagger call test"
│ ✔ ModuleSource.resolveDirectoryFromCaller(ignore: ["**/node_modules", "node_modules", ".git"], path: "."): Directory! 1.4s
Any help would be appreciated! Thanks