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

Create Gherkin tests for Population Density Data #44

Merged
merged 8 commits into from
Sep 11, 2024

Conversation

jgarciahospital
Copy link
Collaborator

What type of PR is this?

Add one of the following kinds:

  • tests

What this PR does / why we need it:

Including test proposal for population density data 0.1.1

Which issue(s) this PR fixes:

Fixes #37

Copy link
Collaborator

@bigludo7 bigludo7 left a comment

Choose a reason for hiding this comment

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

See few comments for the test Definition.

Not sure why the README.md & checklist part of this PR.

And the response property "$.status" value is "SUPPORTED_AREA"
And the response property "$.timedPopulationDensityData[*].startTime" is equal to or later than request body property "$.startDate"
And the response property "$.timedPopulationDensityData[*].endTime" is equal to or earlier than request body property "$.endDate"
And the response property "$.timedPopulationDensityData[*].cellPopulationDensityData[*].populationDensityData.dataType.datatype" is equal to "LOW_DENSITY" or "DENSITY_ESTIMATION"
Copy link
Collaborator

Choose a reason for hiding this comment

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

duplicate datatype no?
should be "$.timedPopulationDensityData[*].cellPopulationDensityData[*].populationDensityData.dataType" is equal to "LOW_DENSITY" or "DENSITY_ESTIMATION"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

to be solved

And the response property "$.status" value is "SUPPORTED_AREA"
And the response property "$.timedPopulationDensityData[*].startTime" is equal to or later than request body property "$.startDate"
And the response property "$.timedPopulationDensityData[*].endTime" is equal to or earlier than request body property "$.endDate"
And the response property "$.timedPopulationDensityData[*].cellPopulationDensityData[*].populationDensityData.dataType.datatype" is equal to "LOW_DENSITY" or "DENSITY_ESTIMATION"
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we add that
"$.timedPopulationDensityData[*].cellPopulationDensityData[*].populationDensityData.maxPplDensity must be filled?
same for minPplDensity and pplDensity

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

to be solved

And the response property "$.status" value is "PART_OF_AREA_NOT_SUPPORTED"
And the response property "$.timedPopulationDensityData[*].startTime" is equal to or later than request body property "$.startDate"
And the response property "$.timedPopulationDensityData[*].endTime" is equal to or earlier than request body property "$.startDate"
And there is at least one item in response property "$.timedPopulationDensityData[*].cellPopulationDensityData[*].datatype" equal to "NO_DATA"
Copy link
Collaborator

Choose a reason for hiding this comment

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

and add:
And there is at least one item in response property "$.timedPopulationDensityData[*].cellPopulationDensityData[*].datatype" equal to "LOW_DENSITY" or "DENSITY_ESTIMATION"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

to be solved

Copy link

@tanjadegroot tanjadegroot Sep 10, 2024

Choose a reason for hiding this comment

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

@jgarciahospital : is it solved ?

Copy link
Collaborator

@bigludo7 bigludo7 Sep 10, 2024

Choose a reason for hiding this comment

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

For me yes :) line 61

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks ludovic, solved then.

And the response property "$.status" value is "AREA_NOT_SUPPORTED"
And the response property "$.timedPopulationDensityData" is an empty array

@population_density_data_04_webhook_success_scenario
Copy link
Collaborator

Choose a reason for hiding this comment

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

I have an issue on this one because we are not aligned with commonalities for the webjook. It should be sink & sinkCredential. See commonalities or carrier billing API where the pattern has been aligned. I will post an issue.

If you consider that it's tool ate to align not sure keeping the test worthwhile.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

and here we have the tricky one. This also requires changes in the API yaml, but APi is now in the public release phase. @bigludo7 let me propose something, please confirm:

  • we create a new PR to update API yaml
  • we update this .feature also with this and other changes
  • updates are reported in the Prepare release r1.2 #45

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hello @jgarciahospital
This is tricky yes.
@rartych provided another view: as this API did not use strictly the explicit subscription model, this is is not an issue for him. So perhaps we can change....nothing here for this version (and keep this test) and we aligne for next release.
WDYT? I'm a bit nervous to have all these change...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rartych any proposal about this? Just to ensure that we close it before review. No problem with any of the options, I think we can provide both code proposals now.

Copy link

Choose a reason for hiding this comment

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

I would stay with the current definition and discuss changes for version 0.2 of the API. In fact we don't have here Event Notification defined in https://github.com/camaraproject/Commonalities/blob/main/documentation/API-design-guidelines.md#12-subscription-notification--event , but asynchronous response. There are also no explicit guidelines for that scenario in Commonalities.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, let me then update gherkin with only the rest of small comments coming from @bigludo7, and also main yaml with some only editorials, and we are ready for closing the release.

Please @sachinvodafone confirm after that review for been able to merge the test plan.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry, making one additional review we find that QoD API suffered similar issue and finally they made the alignement (this Issue & PR summarizes). So, just for aligning with https://github.com/camaraproject/Commonalities/blob/main/documentation/API-design-guidelines.md#instance-based-implicit-subscription, let me propose to roll back to initial plan and:

  • Update gherkin to be aligned with async auth
  • Update API yaml (I'll create a separate PR moving back to wip version)
  • Later we can sync this with the release PR

@jgarciahospital
Copy link
Collaborator Author

See few comments for the test Definition.

Not sure why the README.md & checklist part of this PR.

Thanks Ludo for the review!

readme.md is just to delete the readme of the test definitions folder, now that we have another file.
Checklist is just to include the test reference.

Including small typos correction and alignement of "$.sink" and "$.sinkCredentials" properties.
Copy link
Collaborator

@bigludo7 bigludo7 left a comment

Choose a reason for hiding this comment

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

Sorry still one comment but this one break the file if not resolved.

And the request property "$.sinkCredentials.credentialType" is set to "ACCESSTOKEN"
And the request property "$.sinkCredentials.accessTokenType" is set to "bearer"
And the request property "$.sinkCredentials.accessToken" is set to a valid access token accepted by the events receiver
And the request property "$.sinkCredentials.accessTokenExpiresUtc" is set to a value long enough in the future When the request "retrievePopulationDensity" is sent
Copy link
Collaborator

Choose a reason for hiding this comment

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

Typo here - When the request....must be on the next line

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

solved

Copy link
Collaborator

@bigludo7 bigludo7 left a comment

Choose a reason for hiding this comment

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

LGTM

@jgarciahospital
Copy link
Collaborator Author

Same here, thanks @bigludo7 . @sachinvodafone please for your validation.


Background: Common retrievePopulationDensity setup
Given an environment at "apiRoot"
And the resource "/population-density-data/v1/retrieve"

Choose a reason for hiding this comment

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

should be v0.1 in the url

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

Choose a reason for hiding this comment

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

Recommendation: The filename should be population-density-data-API-Readiness-Checklist.md
Links to this file should then be updated as well, if any (e.g. on API release tracker)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Solved, to be spotted in #45 to ensure it is maintained when merging.

Copy link

@tanjadegroot tanjadegroot left a comment

Choose a reason for hiding this comment

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

It looks good to me except for the statement that still needs to be resolved. Should it be resolved ? if so please do and then for this PR: LGTM from RM

And the response property "$.status" value is "PART_OF_AREA_NOT_SUPPORTED"
And the response property "$.timedPopulationDensityData[*].startTime" is equal to or later than request body property "$.startDate"
And the response property "$.timedPopulationDensityData[*].endTime" is equal to or earlier than request body property "$.startDate"
And there is at least one item in response property "$.timedPopulationDensityData[*].cellPopulationDensityData[*].datatype" equal to "NO_DATA"
Copy link

@tanjadegroot tanjadegroot Sep 10, 2024

Choose a reason for hiding this comment

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

@jgarciahospital : is it solved ?

@tanjadegroot
Copy link

tanjadegroot commented Sep 11, 2024

@jgarciahospital jgarciahospital merged commit 79c89d7 into main Sep 11, 2024
1 check passed
@jgarciahospital jgarciahospital deleted the jgarciahospital-patch-4 branch September 11, 2024 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Creation of Basic API test cases & documentation (meta-release item 7)
5 participants