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

Add JUnit Test Reports to build outputs. #15271

Merged
merged 36 commits into from
Aug 9, 2022

Conversation

davinchia
Copy link
Contributor

@davinchia davinchia commented Aug 3, 2022

What

It's difficult today to parse all the logs from tests. Engineers waste time scrolling through the log outputs and looking for the relevant stack trace.

This PR adds an action to generate a JUnit report so devs can understand test results at a glance. This generates 3 reports for each of the main build jobs when the build completes. We leave the frontend build out since this is aggregated by cypress.

Screenshot 2022-08-04 at 9 10 57 PM

See https://github.com/airbytehq/airbyte/pull/15271/checks?check_run_id=7683783016 for an example of how this works.

How

  • Use the https://github.com/dorny/test-reporter action and configure this to look at the Jacoco test report output for top level and second level builds.
  • Comment out the trap commands to output logs. Though this can be useful for debugging, there is little practical use in the day-to-day, and results in extremely noisy logs.

See https://github.com/airbytehq/airbyte/pull/15271/checks?check_run_id=7683783016 as an output example.

Recommended reading order

  1. gradle.yaml contains the main changes.

🚨 User Impact 🚨

Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.

Pre-merge Checklist

Expand the relevant checklist and delete the others.

New Connector

Community member or Airbyter

  • Community member? Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the connector is published, connector added to connector index as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here
Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub and connector version bumped by running the /publish command described here
Connector Generator
  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed

Tests

Unit

Put your unit tests output here.

Integration

Put your integration tests output here.

Acceptance

Put your acceptance tests output here.

@davinchia davinchia temporarily deployed to more-secrets August 3, 2022 22:08 Inactive
@davinchia davinchia temporarily deployed to more-secrets August 3, 2022 22:23 Inactive
@davinchia davinchia temporarily deployed to more-secrets August 3, 2022 22:38 Inactive
@davinchia davinchia temporarily deployed to more-secrets August 3, 2022 22:49 Inactive
@davinchia davinchia temporarily deployed to more-secrets August 3, 2022 22:56 Inactive
@davinchia davinchia temporarily deployed to more-secrets August 3, 2022 23:10 Inactive
@davinchia davinchia temporarily deployed to more-secrets August 3, 2022 23:29 Inactive
@davinchia davinchia temporarily deployed to more-secrets August 3, 2022 23:45 Inactive
@davinchia davinchia temporarily deployed to more-secrets August 4, 2022 00:14 Inactive
@davinchia davinchia temporarily deployed to more-secrets August 5, 2022 00:12 Inactive
@davinchia davinchia marked this pull request as ready for review August 5, 2022 04:15
@davinchia davinchia temporarily deployed to more-secrets August 5, 2022 04:16 Inactive
Copy link
Contributor

@supertopher supertopher left a comment

Choose a reason for hiding this comment

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

Looks great, I'm excited about these changes

giphy-4

uses: dorny/test-reporter@v1
if: always() # run this step even if previous step failed
with:
name: Platform Test Report with Docker E2E Test
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm really trying to take to heart the idea that we strive to communicate as clearly and loudly as possible when showing developers how to fix their own problems.

is there a name for this test that more clearly screams what it is? How can we get every developer to know there is a better error message process over here?

@@ -626,6 +650,14 @@ jobs:
run: |
CI=true IS_MINIKUBE=true ./tools/bin/acceptance_test_kube.sh

- name: Generate Test Report
uses: dorny/test-reporter@v1
if: always() # run this step even if previous step failed
Copy link
Contributor

Choose a reason for hiding this comment

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

like the note

@@ -13,7 +13,8 @@ VERSION=dev TRACKING_STRATEGY=logging USE_STREAM_CAPABLE_STATE=true docker-compo

# Sometimes source/dest containers using airbyte volumes survive shutdown, which need to be killed in order to shut down properly.
shutdown_cmd="docker-compose down -v || docker kill \$(docker ps -a -f volume=airbyte_workspace -f volume=airbyte_data -f volume=airbyte_db -q) && docker-compose down -v"
trap "echo 'docker-compose logs:' && docker-compose logs -t --tail 1000 && $shutdown_cmd" EXIT
# Uncomment for debugging. Warning, this is verbose.
Copy link
Contributor

Choose a reason for hiding this comment

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

nice add for UX

@davinchia davinchia temporarily deployed to more-secrets August 5, 2022 15:08 Inactive
Copy link
Contributor

@git-phu git-phu left a comment

Choose a reason for hiding this comment

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

looks good!

.github/workflows/gradle.yml Outdated Show resolved Hide resolved
@davinchia davinchia temporarily deployed to more-secrets August 5, 2022 16:29 Inactive
…m:airbytehq/airbyte into davinchia/remove-unnecessary-test-logging
@davinchia davinchia temporarily deployed to more-secrets August 5, 2022 21:47 Inactive
@davinchia davinchia temporarily deployed to more-secrets August 6, 2022 00:20 Inactive
@davinchia davinchia temporarily deployed to more-secrets August 8, 2022 03:01 Inactive
@davinchia davinchia temporarily deployed to more-secrets August 8, 2022 03:53 Inactive
@davinchia davinchia temporarily deployed to more-secrets August 8, 2022 18:54 Inactive
@davinchia davinchia temporarily deployed to more-secrets August 9, 2022 00:00 Inactive
@davinchia davinchia merged commit fd0b769 into master Aug 9, 2022
@davinchia davinchia deleted the davinchia/remove-unnecessary-test-logging branch August 9, 2022 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants