Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating annotations for failed e2e tests #1063

Merged
merged 1 commit into from
Oct 6, 2020

Conversation

xt0rted
Copy link
Member

@xt0rted xt0rted commented Oct 6, 2020

Pull Request Badge

Checklist:

  • If this PR is a new feature, please provide at least one example link
  • Make sure all of the significant new logic is covered by tests

I split this out of #1035 since it's not related to that piece of work.

I'm wondering if we should take a dependency on actions/core so we can use their issueCommand function which handles building & escaping everything.

@stefanbuck
Copy link
Member

I'm wondering if we should take a dependency on actions/core so we can use their issueCommand function which handles building & escaping everything.

I like the simplicity of the console.log, but you made a good point. I think this is something we can look into in separate PR. This is already a huge improvement. Thanks for looking into this.

@stefanbuck stefanbuck merged commit 45db857 into OctoLinker:main Oct 6, 2020
@xt0rted xt0rted deleted the test-annotations branch October 6, 2020 19:03
@@ -16,6 +16,11 @@ async function executeTest(url, targetUrl, selector) {
await page.waitForSelector(`${selector}[href$="${targetUrl}"]`);
}

function createAnnotation({ file, lineNumber, ex }) {
// eslint-disable-next-line no-console
console.log(`::error file=${file},line=${lineNumber}::${ex.message}`);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To support multi-line messages you need to encode \n with %0A

See mheap/phpunit-github-actions-printer#14

@xt0rted
Copy link
Member Author

xt0rted commented Oct 6, 2020

@stefanbuck looks like switching to console.log() doesn't work as expected. Some messages get written out, but others don't because of how the tests are async but not everything is awaited.

https://github.com/OctoLinker/OctoLinker/pull/1048/checks#step:10:51

I tried making everything async but the callback to describe() can't be async so I'm back to square one now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants