Skip to content

tests: fix expect tests and add EOF linter#6122

Merged
algorandskiy merged 9 commits intoalgorand:masterfrom
algorandskiy:pavel/expect-test-cors-fix
Sep 5, 2024
Merged

tests: fix expect tests and add EOF linter#6122
algorandskiy merged 9 commits intoalgorand:masterfrom
algorandskiy:pavel/expect-test-cors-fix

Conversation

@algorandskiy
Copy link
Copy Markdown
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.

@codecov
Copy link
Copy Markdown

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
Comment thread test/e2e-go/cli/goal/expect/goalExpectCommon.exp Outdated
Copy link
Copy Markdown
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

Comment thread test/e2e-go/cli/goal/expect/goalExpectCommon.exp Outdated
Comment thread test/e2e-go/cli/goal/expect/goalExpectCommon.exp
@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
Comment thread test/e2e-go/cli/goal/expect/tealConsensusTest.exp
Copy link
Copy Markdown
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?

Comment thread Makefile
@algorandskiy algorandskiy deleted the pavel/expect-test-cors-fix branch March 16, 2026 20:05
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