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

Add get followers test #604

Merged
merged 12 commits into from
Aug 9, 2024
Merged

Conversation

eucyt
Copy link
Contributor

@eucyt eucyt commented Aug 7, 2024

client.getFollowers(null, 99) must issue a request url like /v2/bot/followers/ids?limit=99. There must not be start as request parameter. This change adds a test to verify this.

@CLAassistant
Copy link

CLAassistant commented Aug 7, 2024

CLA assistant check
All committers have signed the CLA.

@Yang-33 Yang-33 marked this pull request as draft August 7, 2024 06:31
@eucyt
Copy link
Contributor Author

eucyt commented Aug 8, 2024

Now I confirmed new test added!
image

Comment on lines 49 to 55
- name: Generate code
run: |
export PATH=$PATH:~/bin/openapitools/
bash tools/gen-oas-client.sh

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that this code is unnecessary. This is because it causes a discrepancy with the actual commit content, leading to tests being conducted in that state, and the code generated by this script is not reflected in the PR. Since the differences generated by oas are submitted in a separate PR by diff-check.yaml, it seems unnecessary to do it here.

Copy link
Contributor

@Yang-33 Yang-33 Aug 8, 2024

Choose a reason for hiding this comment

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

Since your change is finally deleted here(

bash tools/gen-oas-client.sh
) as well, I cannot accept deleting this.

Isn't the deletion of existing code during code generation itself problematic?

There are two options for a solution:

  1. Remove only the script that deletes existing code, but keep the call to gen-oas-client.sh.
  2. Move the location where test files are placed to somewhere other than ./src/clients/<project>.

Copy link
Contributor Author

@eucyt eucyt Aug 8, 2024

Choose a reason for hiding this comment

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

Out of the options mentioned above, I think option 1 is preferable.
Option 2 does not fundamentally solve the problem, and other contributors might encounter the same issue.

However, this would mean that tests are conducted in a state where there are newly added or edited files that are not reflected in the differences shown in the PR. Is this acceptable?

Copy link
Contributor Author

@eucyt eucyt Aug 8, 2024

Choose a reason for hiding this comment

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

Since your change is finally deleted here as well, I cannot accept deleting this.

The reason I allowed the execution of gen-oas-client.sh in diff-check.yml is that the deleted or edited code is displayed as a difference in the PR, ensuring that tests are not conducted in an unintended state. However, I agree, it is not ideal for the code to be deleted or edited in the first place 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

However, this would mean that tests are conducted in a state where there are newly added or edited files that are not reflected in the differences shown in the PR. Is this acceptable?

No it's not acceptable.

In this case, it would be appropriate to check for any differences using a separate job.
When there are differences other than those in the PR, marking the CI results as failed will alert us that there is invisible extra diff.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've implemented it with option 2 after all.

  • If I eliminate rm -rf $REPO_ROOT_DIR/src/clients/$schema, we won't be able to update the deleted items within the auto-generated code. In other words, no code other than the auto-generated one should be placed under clients/$schema.
  • Generally, in PHP, tests are often placed in tests/unit at the same level as the src directory. FYI

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks!

@eucyt eucyt marked this pull request as ready for review August 8, 2024 02:01
Copy link
Contributor

@Yang-33 Yang-33 left a comment

Choose a reason for hiding this comment

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

commented

@eucyt eucyt requested a review from Yang-33 August 8, 2024 04:08
@eucyt eucyt self-assigned this Aug 8, 2024
@@ -6,6 +6,58 @@ on:
merge_group:

jobs:
diff-check:
Copy link
Contributor

Choose a reason for hiding this comment

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

did you check if it works as expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@Yang-33 Yang-33 left a comment

Choose a reason for hiding this comment

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

LGTM though I left 1 comment(#604 (comment))

@eucyt eucyt merged commit c3d5e8c into line:master Aug 9, 2024
5 checks passed
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.

3 participants