#Extracting test artifacts when tests fail

1 messages · Page 1 of 1 (latest)

frank minnow
#

Hi,

I'm running Playwright tests in Dagger using the Node SDK. When the tests fail, I would like to extract the JUnit results and trace.zip files that are created to upload as artifacts in my Github Actions CI.

Currently, when the tests fail, I get an exit code of 1, which is what I need so that the job fails as it should in Github CI. But, after the, fail, I can't access the container to extract the artifacts. I've tried wrapping the code in a try/catch or try/finally block, but it appears to have no effect on the exit code, and none of the Typescript code that follows test execution is run. Is there an example somewhere of how to extract the artifacts from a container after tests fail?

Thanks in advance. So excited to replace most of my Github workflows with Dagger!

#

Extracting test artifacts when tests fail

dusty field
frank minnow
#

Thank you. That's exactly what I was looking for. Going to test it out now.

dusty field
#

great! let us know how it goes!

frank minnow
#

Worked like a charm. Thank you!

earnest shard
dusty field
earnest shard
#

What happened when the test failed npm throws an error and the then nothing was exported. To fix that I did the following and this is working like a charm.

dusty field