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

refactor: DSL indentation in tests inside pkg server #1620

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

00chorch
Copy link
Contributor

@00chorch 00chorch commented May 13, 2024

Fixes #1339 for package server

Description

Now that openfga/language parser has better support for whitespaces, refactor to
have better readability in the test files.

References

Issue #1302
Continuation of closed PR #1597

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

@00chorch
Copy link
Contributor Author

I see check on "Pull Request / test (pull_request)" has lots of errors that I can't replicate on my local while running make test

Seems to be integration tests running while dependency (MySQL / GRPC) not ready. E.g.:

--- FAIL: TestListObjectsMySQL (10.43s)
tests.go:62: creating connection to address 0.0.0.0:33907
testutils.go:196: 2024-05-13 20:42:59.269219271 +0000 UTC m=+42.071750930 not serving yet at address 0.0.0.0:33907 rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp 0.0.0.0:33907: connect: connection refused"

rpc error: code = Code(4000) desc = Internal Server Error {"grpc_service": "openfga.v1.OpenFGAService", "grpc_method": "CreateStore", "grpc_type": "unary", "user_agent": "grpc-go/1.63.2", "raw_request": {"name":"ignores_irrelevant_contextual_tuples_because_different_user"}, "raw_response": {"code":"internal_error","message":"Internal Server Error"}, "peer.address": "127.0.0.1:49068", "request_id": "4114bcdb-da9a-4d06-a884-f608cbcb59ff", "grpc_code": 4000, "internal_error": "sql error: driver: bad connection"}

May I get any help/support to troubleshoot?

@00chorch 00chorch changed the title Refactor tests dst indentation refactor: DSL indentation in tests inside pkg server May 13, 2024
@00chorch 00chorch marked this pull request as draft May 18, 2024 18:47
…pkg server

Pushing 1 file at a time to try to trobleshot git test workflow error
@00chorch 00chorch force-pushed the refactor-tests-dst-indentation branch from 85cfff9 to f907195 Compare May 20, 2024 19:35
Copy link

codecov bot commented May 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.26%. Comparing base (e8f0200) to head (1fffe95).
Report is 2 commits behind head on main.

Current head 1fffe95 differs from pull request most recent head 73c3aee

Please upload reports for the commit 73c3aee to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1620      +/-   ##
==========================================
+ Coverage   86.21%   86.26%   +0.05%     
==========================================
  Files          90       90              
  Lines        8466     8466              
==========================================
+ Hits         7298     7302       +4     
+ Misses        825      823       -2     
+ Partials      343      341       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…pkg server

Pushing 1 file at a time to try to trobleshot git test workflow error
Pushing 1 file at a time to try to troubleshoot git test workflow error
Pushing 1 file at a time to try to troubleshoot git test workflow error
Pushing 1 file at a time to try to troubleshoot git test workflow error.
Now going one function at a time to isolate source of error.
@00chorch
Copy link
Contributor Author

  • I just realized this ticket is affected by Flaky MySQL tests #1401
  • Manually validated that if I compare old DSL with indented one, both produce the same JSON

TODO [for me]:

  • During the week I will re-submit pending files and ask for PR review if all tests pass.
  • If there's a flaky test, I'll try doing resubmissions

Pushing remaining test files of pkg server.
There's a known issue with some flaky tests (see openfga#1401) that might make
github workflow "pull requests / tests" fail
Can't reproduce locally, so pushing to draft PR to observe behavior
@codecov-commenter
Copy link

codecov-commenter commented May 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.21%. Comparing base (7ea96f3) to head (6eb469e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1620   +/-   ##
=======================================
  Coverage   86.21%   86.21%           
=======================================
  Files          90       90           
  Lines        8466     8466           
=======================================
  Hits         7298     7298           
  Misses        825      825           
  Partials      343      343           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@00chorch 00chorch marked this pull request as ready for review May 24, 2024 01:52
@00chorch 00chorch force-pushed the refactor-tests-dst-indentation branch from 480fbd8 to 36048db Compare May 28, 2024 00:52
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.

None yet

2 participants