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

Fix: Some file tests that should have failed always pass in Github repo. #441

Merged
merged 2 commits into from
Dec 29, 2022

Conversation

piux2
Copy link
Contributor

@piux2 piux2 commented Dec 21, 2022

Description

#440 1 of 3

The actual is the same as and wanted results in the test file. However, in the run time, when go.parser parses the wanted comment, it recognizes up to two lines of // style comments. parser.ParseComments() already returns two newline max. Since prinln(renderedContent) returns three new lines, it always fails. Therefore, we can not use println in the file test if the rendered content already has two new lines.

replacing println() with print() will fix it.

How has this been tested?

  1. set syncWanted=false in tests/file.go
  2. make gnodev
  3. make test.examples

Copy link
Contributor Author

@piux2 piux2 left a comment

Choose a reason for hiding this comment

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

Description:

#440 2 of 3

All these tests failed because we restructured the example naming space, and the package path changed. As a result, the package address and realm object hashes changed. However, the package address in std7.gno and realm object hashes in zrealm_exmaple.gno, zrealm_test0.gno still have the value before the changes.

How has this been tested?

  1. set syncWanted=false in tests/file.go
  2. make gnodev
  3. make test.files2

@piux2 piux2 changed the title limit out put comment new lines in file test. Fix: Some file tests that should have failed always pass in Github repo. Dec 21, 2022
@moul
Copy link
Member

moul commented Dec 22, 2022

Thank you @piux2,

We need to make sure that the CI is failing when it should.
Do you think some tests may still be ignored by the CI?

@piux2
Copy link
Contributor Author

piux2 commented Dec 23, 2022

Thank you @piux2,

We need to make sure that the CI is failing when it should. Do you think some tests may still be ignored by the CI?

Before we fix the syncWanted in step 3 of 3, CI ignores all file tests that need to match the output and realm objects. However, If we turn it off now, CI will fail for the above testing cases because the testing case needs to be updated. So the sequence is essential.

1 of 3 and 2 of 3 are to fix the testing cases. After merging, we can do step 3 of 3; I will check in the code that sets syncWanted=false and add syncWanted as a flag in the gnodev for local testing. After that, CI will fail on future changes that break the tests as expected.

Copy link
Member

@moul moul left a comment

Choose a reason for hiding this comment

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

Great.

@moul moul merged commit cabc1ad into gnolang:master Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🌟 Wanted for Launch
Development

Successfully merging this pull request may close these issues.

2 participants