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

feat: new automation scope for tests on Contracts API + Tokens API #170

Conversation

olehbairak
Copy link
Collaborator

@olehbairak olehbairak commented Feb 14, 2024

What ❔

Implemented automation test coverage for next test cases:
https://linear.app/matterlabs/issue/QA-653/%5Btokensapi-contracts-api%5D-automate-test-cases-for-contracts-api-for-be

Why ❔

To check this functionality in PR automation integration tests.

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.

@olehbairak olehbairak added the automation writing/fixing/maintaining auto-tests/e2e-tests label Feb 14, 2024
@olehbairak olehbairak self-assigned this Feb 14, 2024
Copy link

github-actions bot commented Feb 14, 2024

API E2E Test Results

206 tests   206 ✅  20s ⏱️
 14 suites    0 💤
  1 files      0 ❌

Results for commit 98f183d.

♻️ This comment has been updated with latest results.

@olehbairak olehbairak changed the title fix: new one feat: new automation scope for tests on Contracact API + Tokens API Feb 14, 2024
Copy link

github-actions bot commented Feb 14, 2024

Visit the preview URL for this PR (updated for commit 98f183d):

(expires Fri, 12 Apr 2024 12:19:36 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: e508f9012944951194447cb8885950b451a24403

Copy link

github-actions bot commented Feb 14, 2024

Unit Test Results

    4 files    263 suites   11m 55s ⏱️
2 079 tests 2 078 ✅ 1 💤 0 ❌
2 284 runs  2 283 ✅ 1 💤 0 ❌

Results for commit 98f183d.

♻️ This comment has been updated with latest results.

@olehbairak olehbairak marked this pull request as ready for review February 16, 2024 15:34
@olehbairak
Copy link
Collaborator Author

@pcheremu can you please review the PR?
Thank you in advance.

@olehbairak olehbairak changed the base branch from integration-tests to integration-tests-signed February 21, 2024 15:24
Copy link
Collaborator

@pcheremu pcheremu left a comment

Choose a reason for hiding this comment

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

@olehbairak please, apply changes based on comments

@olehbairak
Copy link
Collaborator Author

@olehbairak please, apply changes based on comments

@pcheremu thank you for the feedback!
Already fixed!

Copy link
Collaborator

@pcheremu pcheremu left a comment

Choose a reason for hiding this comment

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

@abilevych all essential changes were applied. I'm still thinking about helper.performGETrequest(apiRoute). From the one hand we can have an agreement that if we use just one variable it will mean that the network will be local, from the other hand, as for me, it will be more clear to have two arguments helper.performGETrequest(apiRoute, network) to transfer there more explicitly. Both options are make sense, please let us know what would you prefer in this case?

packages/integration-tests/src/helper.ts Outdated Show resolved Hide resolved
packages/integration-tests/src/helper.ts Outdated Show resolved Hide resolved
@@ -61,8 +61,14 @@ export class Helper {
return new Promise((resolve) => setTimeout(resolve, ms));
}

async performGETrequest(apiRoute: string) {
return request(environment.blockExplorerAPI).get(apiRoute);
async performGETrequest(apiRoute: string, network = "local") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, I assume the name "environment" is a better option for a parameter than the "network" is.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

environment name is already used in config.ts
image

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

@@ -22,6 +22,59 @@ describe("API module: Contract", () => {
await playbook.deployMultiCallContracts();
});

//id1851
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd mark here by tag\comment that tests or suite related to the Sepolia network (or environment)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added

await helper.retryTestAction(async () => {
apiRoute = `/api?module=contract&action=checkverifystatus&guid=3177`;
response = await helper.performGETrequest(apiRoute, "sepolia");
console.log(response.body);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is that necessary to have it here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed

packages/integration-tests/tests/api/tokens.test.ts Outdated Show resolved Hide resolved
@olehbairak
Copy link
Collaborator Author

@pcheremu @abilevych I fixed comments.
Can you please review the changes?
Thank you in advance!

…sapi-accounts-api-automate-test-cases-for-contracts-api
@olehbairak olehbairak requested review from abilevych and pcheremu and removed request for pcheremu and abilevych March 7, 2024 10:15
olehbairak and others added 6 commits March 7, 2024 11:42
…53-tokensapi-accounts-api-automate-test-cases-for-contracts-api"

This reverts commit e2445ba, reversing
changes made to f628183.
…rak-qa-653-tokensapi-accounts-api-automate-test-cases-for-contracts-api""

This reverts commit 7fa1b56.
…sapi-accounts-api-automate-test-cases-for-contracts-api
…sapi-accounts-api-automate-test-cases-for-contracts-api
@olehbairak olehbairak changed the title feat: new automation scope for tests on Contracact API + Tokens API feat: new automation scope for tests on Contracts API + Tokens API Mar 11, 2024
@olehbairak
Copy link
Collaborator Author

@abilevych conflicts were resolved.
Now branch is up to date and ready for review.

@abilevych
Copy link
Collaborator

@abilevych all essential changes were applied. I'm still thinking about helper.performGETrequest(apiRoute). From the one hand we can have an agreement that if we use just one variable it will mean that the network will be local, from the other hand, as for me, it will be more clear to have two arguments helper.performGETrequest(apiRoute, network) to transfer there more explicitly. Both options are make sense, please let us know what would you prefer in this case?

@abilevych abilevych closed this Apr 5, 2024
@abilevych abilevych reopened this Apr 5, 2024
@abilevych
Copy link
Collaborator

@olehbairak I messed up a bit with git (closed the PR by mistake). please re-start all those checks if it's needed and once it's done you can merge it by yourself.

Sorry for some inconvenience

@olehbairak
Copy link
Collaborator Author

@olehbairak please, apply changes based on comments

@pcheremu can you please resolve the request change - it's currently blocking from merge.
Seems like all the requested changes were made and the PR can be merged.
Thank you in advance!

@olehbairak olehbairak merged commit 26cf37a into integration-tests-signed Apr 8, 2024
68 of 69 checks passed
@olehbairak olehbairak deleted the oleh-bairak-qa-653-tokensapi-accounts-api-automate-test-cases-for-contracts-api branch April 8, 2024 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation writing/fixing/maintaining auto-tests/e2e-tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants