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

Bmoric/controller utest #21882

Merged
merged 20 commits into from
Mar 2, 2023
Merged

Bmoric/controller utest #21882

merged 20 commits into from
Mar 2, 2023

Conversation

benmoriceau
Copy link
Contributor

@benmoriceau benmoriceau commented Jan 25, 2023

What

Add a UTest to check the return code of our API endpoints.

How

Create a UTEST (actually, it is more an integration test) that checks that the endpoint we're call returns the expected code. This PR only contains the HealthCheck. Other PR(s) will add the other endpoints.

@octavia-squidington-iv octavia-squidington-iv added area/platform issues related to the platform area/server labels Jan 25, 2023
@benmoriceau benmoriceau temporarily deployed to more-secrets January 25, 2023 20:57 — with GitHub Actions Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets January 25, 2023 20:57 — with GitHub Actions Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets January 27, 2023 00:26 — with GitHub Actions Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets January 27, 2023 00:26 — with GitHub Actions Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets January 27, 2023 18:13 — with GitHub Actions Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets January 27, 2023 18:13 — with GitHub Actions Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets January 30, 2023 18:21 — with GitHub Actions Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets January 30, 2023 18:21 — with GitHub Actions Inactive
@benmoriceau benmoriceau marked this pull request as ready for review January 30, 2023 18:34
@benmoriceau benmoriceau requested a review from a team as a code owner January 30, 2023 18:34
@benmoriceau benmoriceau temporarily deployed to more-secrets January 30, 2023 18:36 — with GitHub Actions Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets January 30, 2023 18:36 — with GitHub Actions Inactive

@Test
void testHealth() throws IOException {
Mockito.when(healthCheckHandler.health())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The lack of this mocking is the reason why we were runnign in a NotFound error. It was not because the route was not register but because the response was null which lead micronaut to return a notFound error.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 30, 2023

Airbyte Code Coverage

File Coverage [100%] 🍏
InvalidInputExceptionHandler.java 100% 🍏
Total Project Coverage 27.79% 🍏

* Add attempt and connection test

* Add more test

* Add more test

* pmd
@benmoriceau benmoriceau temporarily deployed to more-secrets January 31, 2023 01:45 — with GitHub Actions Inactive
defaultValue = StringUtils.TRUE,
value = StringUtils.TRUE)
@SuppressWarnings("PMD.AbstractClassWithoutAbstractMethod")
abstract class BaseControllerTest {
Copy link
Contributor

Choose a reason for hiding this comment

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

It could be useful to add some comments about the intent of the tests (testing the error wrapping of the controllers mostly?). It feels very redundant to add that to every single test class, the base class might be a good place for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@benmoriceau benmoriceau enabled auto-merge (squash) February 15, 2023 17:29
@benmoriceau
Copy link
Contributor Author

Tagged as ready to ship since it is only UTests

@benmoriceau benmoriceau temporarily deployed to more-secrets February 15, 2023 17:30 — with GitHub Actions Inactive
@benmoriceau benmoriceau temporarily deployed to more-secrets February 15, 2023 17:31 — with GitHub Actions Inactive
@c-p-b c-p-b temporarily deployed to more-secrets February 16, 2023 18:07 — with GitHub Actions Inactive
@c-p-b c-p-b temporarily deployed to more-secrets February 16, 2023 18:08 — with GitHub Actions Inactive
@c-p-b
Copy link
Contributor

c-p-b commented Feb 16, 2023

/create-platform-pr

@perangel perangel temporarily deployed to more-secrets February 17, 2023 14:04 — with GitHub Actions Inactive
@perangel perangel temporarily deployed to more-secrets February 17, 2023 14:04 — with GitHub Actions Inactive
@c-p-b
Copy link
Contributor

c-p-b commented Feb 20, 2023

/create-platform-pr

@benmoriceau
Copy link
Contributor Author

/create-platform-pr

@benmoriceau benmoriceau merged commit da17885 into master Mar 2, 2023
@benmoriceau benmoriceau deleted the bmoric/controller-utest branch March 2, 2023 21:21
benmoriceau added a commit that referenced this pull request Mar 2, 2023
benmoriceau added a commit that referenced this pull request Mar 2, 2023
benmoriceau added a commit that referenced this pull request Mar 2, 2023
jbfbell pushed a commit that referenced this pull request Mar 6, 2023
* Tmp

* Tmp

* Tmp

* tmp

* Make test to work

* PMD and update test

* Bmoric/add more controller tests (#22113)

* Add attempt and connection test

* Add more test

* Add more test

* pmd

* Rm unused import

* Add comment

* More test and address comments

* PR comments
jbfbell pushed a commit that referenced this pull request Mar 6, 2023
danielduckworth pushed a commit to danielduckworth/airbyte that referenced this pull request Mar 13, 2023
* Tmp

* Tmp

* Tmp

* tmp

* Make test to work

* PMD and update test

* Bmoric/add more controller tests (airbytehq#22113)

* Add attempt and connection test

* Add more test

* Add more test

* pmd

* Rm unused import

* Add comment

* More test and address comments

* PR comments
danielduckworth pushed a commit to danielduckworth/airbyte that referenced this pull request Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/platform issues related to the platform area/server ready-to-ship
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants