Skip to content

[CALCITE-3595] Test infrastructure overwrites reference log with wrong results - #1671

Closed
yanlin-Lynn wants to merge 1 commit into
apache:masterfrom
yanlin-Lynn:CALCITE-3595
Closed

[CALCITE-3595] Test infrastructure overwrites reference log with wrong results#1671
yanlin-Lynn wants to merge 1 commit into
apache:masterfrom
yanlin-Lynn:CALCITE-3595

Conversation

@yanlin-Lynn

Copy link
Copy Markdown
Contributor

See jira CALCIT-3595

new File(
Sources.of(refFile).file().getAbsolutePath()
.replace("test-classes", "surefire"));
.replace(".xml", "_surefire.xml"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what is surefire?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hi @vlsi , I'm not sure I fully understand your question. I try to explain the logic of this PR.
I think the original intention was to create a log file in "surefire" directory, containing the actual relnode tree for sql after run test.
But now, the ref file is not in "test-classes" directory (no test-classes directory exist), make log file and ref file become the same file. So update log file will update ref file too.
This pr just to make sure log file and ref file are different files.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suggest we use a human-understandable naming.
For instance: ${name}.actual.xml. Is it the file with the actual output? WDYT?

Frankly speaking, it is puzzling why xml file is called a log file, but if it works who cares.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should at least add a check here that the charSequence to replace must exists, or, the log file path and ref file path must be different, to avoid such problems when we do later code upgrade.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@danny0405 , for this case ".xml" is sure to exists, the code final URL refFile = findFile(clazz, ".xml"); guarantee that. In case code upgrade in future, I'll add an check to make sure re file and log file are different.

@vlsi I'm OK with both names. I'll update the PR as you suggested.

@danny0405 danny0405 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1

@danny0405 danny0405 added the LGTM-will-merge-soon Overall PR looks OK. Only minor things left. label Dec 19, 2019
@amaliujia

amaliujia commented Dec 19, 2019

Copy link
Copy Markdown
Contributor

Huge +1. Thanks for debugging it!

@hsyuan hsyuan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@danny0405 danny0405 closed this in edc386d Dec 20, 2019
@yanlin-Lynn
yanlin-Lynn deleted the CALCITE-3595 branch December 20, 2019 06:29
wangxlong pushed a commit to wangxlong/calcite that referenced this pull request Feb 13, 2020
jamesstarr pushed a commit to jamesstarr/calcite that referenced this pull request Aug 28, 2025
…g results (Wang Yanlin)

close apache#1671

Change-Id: I53d54c677970ba44a91dd9e6127a38f304a399da
jamesstarr pushed a commit to jamesstarr/calcite that referenced this pull request Mar 16, 2026
…g results (Wang Yanlin)

close apache#1671

Change-Id: I53d54c677970ba44a91dd9e6127a38f304a399da
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LGTM-will-merge-soon Overall PR looks OK. Only minor things left.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants