Fang-Yu Rao has uploaded this change for review. ( http://gerrit.cloudera.org:8080/20272
Change subject: IMPALA-12311: Do not add a trailing newline when updating a golden file ...................................................................... IMPALA-12311: Do not add a trailing newline when updating a golden file join_section_lines() is called to join the lines returned from actual results to update the expected results of the subsection when the actual results do not match the original expected results of a subsection, which could be ERRORS, TYPES, LABELS, or RESULTS. Before this patch, join_section_lines() added a trailing newline at the end of the joined lines, causing the verification of the updated subsection of RESULTS to fail if we used the updated golden file to replace the original one. This additional newline only affected the subsection of RESULTS in that trailing newlines in the subsections of ERRORS, TYPES, and LABELS in a test file are removed when they are constructed in the test. For instance, if we changed a line in the subsection of RESULTS tpcds-decimal_v2-q1.test to make the expected results differ from the actual ones to trigger a call to join_section_lines() with the following on the command line, we would find that the updated subsection could not pass the verification unless we manually removed that additional newline. Recall that the updated golden file by default would be produced under $IMPALA_HOME/logs/ee_tests. $IMPALA_HOME/bin/impala-py.test \ --update_results \ $IMPALA_HOME/tests/query_test/test_tpcds_queries.py::TestTpcdsDecimalV2Query::test_tpcds_q1 This patch removes that trailing newline added in join_section_lines() to resolve the issue. Testing: - Manually verified that when join_section_lines() is called, the updated subsection of RESULTS could pass the verification. Change-Id: Ic7668a437267bd76afecba8f87ead32d82580414 --- M tests/util/test_file_parser.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/72/20272/1 -- To view, visit http://gerrit.cloudera.org:8080/20272 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: Ic7668a437267bd76afecba8f87ead32d82580414 Gerrit-Change-Number: 20272 Gerrit-PatchSet: 1 Gerrit-Owner: Fang-Yu Rao <[email protected]>
