github-action icon indicating copy to clipboard operation
github-action copied to clipboard

Add github code annotation for failed test

Open omry-hay opened this issue 6 years ago • 4 comments

It would be be great if you can add code annotation to failed cypress e2e test. There is a nice example with Jest

image

omry-hay avatar Jan 17 '20 17:01 omry-hay

It looks like the simplest way to do this is to have the action register a problem matcher

Cypress test output however will not reference source lines/files, so we're not going to see in-source annotations like that, but the errors could at least be connected into the annotations list you see highlighted when you open up a failed run

themightychris avatar Jan 25 '20 05:01 themightychris

I was just thinking about this. We could add annotations (super useful), but an update to the output from the Cypress project would be required to get file name/line numbers. A PR to at least add annotations would be a good first step

NicholasBoll avatar Feb 20 '20 16:02 NicholasBoll

@NicholasBoll Actually we have this information. Specifically as part of this PR: https://github.com/cypress-io/cypress/pull/3930

I will have to investigate whether this is being passed through to the reporting output though.

jennifer-shehane avatar Feb 24 '20 05:02 jennifer-shehane

Awesome! Once there is output that can be processed by regular expressions, annotation support is fairly easy to add.

As an example, the parse config for eslint-stylish in the setup-node action is here: https://github.com/actions/setup-node/blob/master/.github/eslint-stylish.json. This is what activates that matcher: https://github.com/actions/setup-node/blob/releases/v1/src/setup-node.ts#L30

NicholasBoll avatar Feb 24 '20 14:02 NicholasBoll