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

tests: fix expect tests and add EOF linter #6122

Merged

Conversation

algorandskiy
Copy link
Contributor

@algorandskiy algorandskiy commented Sep 3, 2024

Summary

While looking why #6089 expect test did not work as expected, I found it copied the expect statement from the CheckNetworkAddressForCors function, and it does not perform check correctly ignoring the fact of missing expected output.
I fixed that by added eof sub statement which is hit when no other statement executed previously and when there is no exp_continue. After that the test started failing since it was checking KMD headers without setting allowed_origins configuration option.

@cce also discovered the same issue in some other tests and added a linter.

Test Plan

This is a test fix.

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.20%. Comparing base (0da0e99) to head (07aaf5a).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6122      +/-   ##
==========================================
- Coverage   56.22%   56.20%   -0.03%     
==========================================
  Files         494      494              
  Lines       69921    69921              
==========================================
- Hits        39313    39299      -14     
- Misses      27941    27954      +13     
- Partials     2667     2668       +1     

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

gmalouf
gmalouf previously approved these changes Sep 4, 2024
Copy link
Contributor Author

@algorandskiy algorandskiy left a comment

Choose a reason for hiding this comment

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

some eofs looks exceeding because of variables checking after the expect statement but does not hurt

test/e2e-go/cli/goal/expect/goalExpectCommon.exp Outdated Show resolved Hide resolved
@algorandskiy algorandskiy changed the title tests: fix expect corsTest tests: fix expect tests and add EOF linter Sep 4, 2024
@algorandskiy algorandskiy requested review from cce and gmalouf September 4, 2024 21:38
Copy link
Contributor

@gmalouf gmalouf left a comment

Choose a reason for hiding this comment

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

Added 1 ask in Makefile - is the idea that eof wasn't being called in some corner cases/we ended up with false positives?

Makefile Show resolved Hide resolved
@algorandskiy algorandskiy merged commit 66b87dc into algorand:master Sep 5, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants