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

MARP-1703 end2 end testing tryout with adding a new test to call to real endpoint #35

Conversation

ntqdinh-axonivy
Copy link
Collaborator

No description provided.

@github-actions github-actions bot added the enhancement New feature or request label Dec 27, 2024
Copy link
Contributor

github-actions bot commented Dec 27, 2024

Test Results

34 tests  +17   34 ✅ +17   24s ⏱️ +5s
 4 suites ± 0    0 💤 ± 0 
 4 files   ± 0    0 ❌ ± 0 

Results for commit 008decc. ± Comparison against base commit 1c96afc.

This pull request removes 17 and adds 34 tests. Note that renamed tests count towards both.
com.axonivy.connector.openweather.test.AirPollutionProcessTest ‑ testGetAirPollutionByGeoCode_ReturnsAirPollution(BpmClient)
com.axonivy.connector.openweather.test.AirPollutionProcessTest ‑ testGetAirPollutionByGeoCode_ThrowsBpmException(BpmClient)
com.axonivy.connector.openweather.test.AirPollutionProcessTest ‑ testGetForecastAirPollutionByGeoCode_ReturnsAirPollution(BpmClient)
com.axonivy.connector.openweather.test.AirPollutionProcessTest ‑ testGetForecastAirPollutionByGeoCode_ThrowsBpmException(BpmClient)
com.axonivy.connector.openweather.test.AirPollutionProcessTest ‑ testGetHistoricalAirPollutionByGeoCode_ReturnsAirPollution(BpmClient)
com.axonivy.connector.openweather.test.AirPollutionProcessTest ‑ testGetHistoricalAirPollutionByGeoCode_ThrowsBpmExceptionCanNotGeo(BpmClient)
com.axonivy.connector.openweather.test.AirPollutionProcessTest ‑ testGetHistoricalAirPollutionByGeoCode_ThrowsBpmExceptionStartMoreThanEnd(BpmClient)
com.axonivy.connector.openweather.test.CurrentWeatherProcessTest ‑ testGetCurrentWeatherByGeoCode_ReturnsCurrentWeather(BpmClient)
com.axonivy.connector.openweather.test.CurrentWeatherProcessTest ‑ testGetCurrentWeatherByGeoCode_ThrowsBpmException(BpmClient)
com.axonivy.connector.openweather.test.ForecastWeatherProcessTest ‑ testGetForecastByGeoCode_ThrowsBpmException(BpmClient)
…
com.axonivy.connector.openweather.test.AirPollutionProcessTest ‑ testGetAirPollutionByGeoCode_ReturnsAirPollution(BpmClient)[1]
com.axonivy.connector.openweather.test.AirPollutionProcessTest ‑ testGetAirPollutionByGeoCode_ReturnsAirPollution(BpmClient)[2]
com.axonivy.connector.openweather.test.AirPollutionProcessTest ‑ testGetAirPollutionByGeoCode_ThrowsBpmException(BpmClient)[1]
com.axonivy.connector.openweather.test.AirPollutionProcessTest ‑ testGetAirPollutionByGeoCode_ThrowsBpmException(BpmClient)[2]
com.axonivy.connector.openweather.test.AirPollutionProcessTest ‑ testGetForecastAirPollutionByGeoCode_ReturnsAirPollution(BpmClient)[1]
com.axonivy.connector.openweather.test.AirPollutionProcessTest ‑ testGetForecastAirPollutionByGeoCode_ReturnsAirPollution(BpmClient)[2]
com.axonivy.connector.openweather.test.AirPollutionProcessTest ‑ testGetForecastAirPollutionByGeoCode_ThrowsBpmException(BpmClient)[1]
com.axonivy.connector.openweather.test.AirPollutionProcessTest ‑ testGetForecastAirPollutionByGeoCode_ThrowsBpmException(BpmClient)[2]
com.axonivy.connector.openweather.test.AirPollutionProcessTest ‑ testGetHistoricalAirPollutionByGeoCode_ReturnsAirPollution(BpmClient)[1]
com.axonivy.connector.openweather.test.AirPollutionProcessTest ‑ testGetHistoricalAirPollutionByGeoCode_ReturnsAirPollution(BpmClient)[2]
…

♻️ This comment has been updated with latest results.

@ntqdinh-axonivy
Copy link
Collaborator Author

ntqdinh-axonivy commented Dec 27, 2024

Hi @ivy-rew
I have just prepared some new test cases for API testing using the approach we discussed in the previous meeting.
Should we remove old test cases (with mock server) that check the response status and the instance of results?
For test cases with mock data to test the logic, we think it still need to keep it as it is, right?

@ivy-rew
Copy link
Member

ivy-rew commented Jan 2, 2025

Hi @ivy-rew I have just prepared some new test cases for API testing using the approach we discussed in the previous meeting. Should we remove old test cases (with mock server) that check the response status and the instance of results? For test cases with mock data to test the logic, we think it still need to keep it as it is, right?

Thanks for reaching out.
I'd not remove the old mock-based tests, they still offer value, documenting how the service worked when the features were developed. Furthermore the mock-service can be used for demos ... simply adding the test-project to a workspace allows presales and others to play with the service while being offline.

Comment on lines 18 to 19
@IvyProcessTest(enableWebServer = true)
public class BaseProcessTest {
Copy link
Member

@ivy-rew ivy-rew Jan 2, 2025

Choose a reason for hiding this comment

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

junit5 should no longer be used with base-classes: normally you'd rather pack such code as in this class in a junit5-extension. And then add it to each test via @RegisterExtension
junit5-ext

Copy link
Member

@ivy-rew ivy-rew left a comment

Choose a reason for hiding this comment

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

Good first steps; let's make more of the standard junit5 features to avoid duplication in our tests.... especially as we are sort of gaining experience how to apply the approach for many connectors.

@ntqdinh-axonivy
Copy link
Collaborator Author

Thanks for your hint on our implementation. I would have a try on your suggestion of multiple environments using TestTemplates and update the document soon. ☺️

@ivy-rew
Copy link
Member

ivy-rew commented Jan 2, 2025

Thanks for your hint on our implementation. I would have a try on your suggestion of multiple environments using TestTemplates and update the document soon. ☺️

cool, note though that it is just a hint. maybe it's not easy to keep both impls sync ... as the service may changes its outputs.
another solution could be to parameterize the stuff only at built time.... by passing system-args to the surefire run and planning the same execution twice ... with differen params.

Copy link

@nqhoan-axonivy nqhoan-axonivy left a comment

Choose a reason for hiding this comment

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

Your approach is very cool and it fits my expectaction.
But please keep the TAB format for all connector as a conversation of market product.
And I just have one small concern in the code, please help to check it.
Thanks!

Copy link

@nqhoan-axonivy nqhoan-axonivy left a comment

Choose a reason for hiding this comment

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

LGTM

@ntqdinh-axonivy ntqdinh-axonivy merged commit 3e7c1c1 into master Jan 8, 2025
8 checks passed
@ntqdinh-axonivy ntqdinh-axonivy deleted the feature/MARP-1703-End2End-Testing-Tryout-with-adding-a-new-Test-to-call-to-real-endpoint branch January 8, 2025 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants