Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Set up xunit endpoint #261

Open
cedpeters opened this issue Aug 21, 2020 · 1 comment
Open

Set up xunit endpoint #261

cedpeters opened this issue Aug 21, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@cedpeters
Copy link
Contributor

No description provided.

@cedpeters cedpeters added the enhancement New feature or request label Aug 21, 2020
@cedpeters cedpeters linked a pull request Aug 21, 2020 that will close this issue
@cedpeters
Copy link
Contributor Author

The goal is to allow users, especially Google's open-source contributors, to post their tests to Flaky.dev.
Users of Kokoro don't use Github actions, so the current tap endpoint doesn't work. Their tests are already being put into an xunit file to send to buildcop bot, so this endpoint will accept data in that format.

#254 has already been landed, which stubs out the endpoint and parses the xunit test data. Its test parsing is based on the parsing done in buildcop bot, here: https://github.com/googleapis/repo-automation-bots/blob/master/packages/buildcop/src/buildcop.ts

Note that the goal is for the new endpoint to accept data, parse it, and then send it to addBuild in the exact same way that the tap parsers do. No code in add-build.js should need to be changed, and the only values that are 100% required to be meaningful (i.e. not set to null or '') in the data structures passed to add-build are the ones which are used as the document id for storing and retrieving data in the database (plus, to be useful, whether a test passed or not). Most of this is already done in that first PR.

The remaining work is mainly to figure out how to send the test result data to the endpoint, and to make sure that the metadata contains all correct information. There are two approaches that have been discussed for this:

  1. Add code to buildcop which sends all required data to Flaky. I have stubbed out an example of what this might look like here: https://github.com/cedpeters/repo-automation-bots/pull/1/files Note that a secret would need to be stored to be sent as Authorization.
  2. Post everything directly to Flaky.dev using PubSub. I'm not sure whether this would require the xunit-parser to do more parsing/cleaning of the metadata, but that could certainly work - we just need to figure out how to ensure the identity of whoever is posting data to the endpoint.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant