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

CLOUDP-278958: trasformation test #306

Merged
merged 4 commits into from
Dec 12, 2024
Merged

CLOUDP-278958: trasformation test #306

merged 4 commits into from
Dec 12, 2024

Conversation

wtrocki
Copy link
Member

@wtrocki wtrocki commented Dec 11, 2024

Proposed changes

Jira ticket: CLOUDP-278958

Descriptions

Adding test to the customization mechanism we use to track possible regressions and issues when postman tooling is updated.

Impact

Releases will require tests to pass. I intentionally made test simple to cover happy path/critical changes only.

Reason

Transformation engine is currently done as set of bash jq commands that are tricky to test and validate.
Transformation files are not committed to the repository and visible during PRs.
We release postman automatically (postman does validation for correctness on backend) but it does not validate our customizations.

Testing

  • Run locally:
▶ make transform_collection_test
./scripts/transform-for-api-test.sh
~/Projects/sandbox/openapi/tools/postman/tmp ~/Projects/sandbox/openapi/tools/postman
Test Passed: Query params disabled successfully.
Test Passed: _postman_id removed successfully.
Test Passed: The first item in the variable array has key set to "baseUrl" and has a value property.
  • CI/CD will be tested after merge.

Future considerations

To fully streamline the experience for postman, we would need to move all the org and group variables to the global level for user convenience. I initially tried to do that, but bash approach does show it's limit:

  • It is difficult to test jq commands which do not fail if entries are missing
  • long execution time - added loop in bash took 610 seconds to run transformation.

In the long run we should look to see if we can migrate transformation engine into scripting language like python, js etc.

@wtrocki wtrocki force-pushed the CLOUDP-278958-tests branch from c799bc6 to c65e29a Compare December 12, 2024 11:12
@wtrocki wtrocki force-pushed the CLOUDP-278958-tests branch from c65e29a to a91ea73 Compare December 12, 2024 11:16
@wtrocki wtrocki changed the title Cloudp 278958 tests CLOUDP-278958: trasformation test Dec 12, 2024
@wtrocki wtrocki marked this pull request as ready for review December 12, 2024 11:35
@wtrocki wtrocki requested a review from a team as a code owner December 12, 2024 11:35
@wtrocki wtrocki merged commit c4d5cb9 into main Dec 12, 2024
11 checks passed
@wtrocki wtrocki deleted the CLOUDP-278958-tests branch December 12, 2024 12:05
wtrocki added a commit that referenced this pull request Dec 12, 2024
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.

2 participants