Skip to content

[CUBRIDQA-1461] keep the diff_ignore_lineno() temporary files - #777

Merged
swi0110 merged 1 commit into
CUBRID:developfrom
swi0110:modify_init.sh_CUBRIDQA-1461
Jul 30, 2026
Merged

[CUBRIDQA-1461] keep the diff_ignore_lineno() temporary files#777
swi0110 merged 1 commit into
CUBRID:developfrom
swi0110:modify_init.sh_CUBRIDQA-1461

Conversation

@swi0110

@swi0110 swi0110 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

문제

#776에서 diff_ignore_lineno()가 생성하는 *_temp_diff 임시파일 2개를 함수 안에서 삭제하도록 바꿨는데, 이 때문에 shell/_38_fig/cbrd_24478/deduplicate 테스트케이스가 실패했습니다.

이 테스트의 case #7은 임시파일의 존재 자체를 검증 조건으로 사용합니다 (deduplicate.sh:66):

compare_result_between_files create_table_data.log create_table_data.answer  #6

if [ -f create_table_data.answer_temp_diff ];then   #7
    write_ok "[create table checked]"
else
    write_nok "[create table fail]"
fi

함수가 파일을 지우면 조건이 절대 참이 되지 않아 write_nok가 실행되고, .result에 NOK가 남아 테스트케이스가 실패합니다.

변경 내용

rm -f를 제거하고 diff를 다시 함수의 마지막 명령으로 되돌립니다. 그러면 diff의 종료 코드가 자연히 함수의 반환값이 되므로 rc 처리도 함께 제거됩니다.

임시파일 정리는 테스트케이스의 책임입니다. shell 테스트케이스의 *_temp_diff 참조 43건을 확인한 결과:

  • 1건은 위와 같이 파일을 읽습니다 (deduplicate.sh:66)
  • 42건은 스크립트 끝에서 직접 삭제합니다. 그중 **13건은 -f 없는 bare rm *_temp_diff**로, 라이브러리가 파일을 먼저 지우면 glob이 매칭되지 않아 이 rm도 실패합니다 (테스트 실패로는 이어지지 않지만 로그에 에러가 남습니다)

#776에서 추가한 영문·한글 마스킹, cp -f, 파일명 인용은 그대로 유지됩니다.

검증

원인 재현 — case #7의 조건을 동일하게 구성해 두 버전을 비교:

init.sh case #7 결과 CTP 판정
develop (rm -f 있음) NOK [create table fail] FAIL
이 브랜치 (rm -f 제거) OK [create table checked] PASS

회귀 확인

  • 마스킹 11건 전부 통과 — 영문 5건, 한글 UTF-8 3건, 한글 EUC-KR 2건, 실제 내용 차이를 검출하는 negative 1건. 이번 되돌림은 마스킹에 영향이 없습니다
  • 종료 코드 여전히 정확: 0(일치) / 1(상이) / 2(에러)
  • bare rm *_temp_diff가 다시 exit=0으로 성공
  • bash -n 통과

참고

grep으로 *_temp_diff 참조를 조사할 때 deduplicate.sh:66이 누락되어 초기에 "모든 참조가 삭제 용도"라고 잘못 판단했습니다. find | xargs grep으로 다시 확인해 읽기 참조 1건을 찾았고, 그것이 정확한 실패 원인이었습니다.

🤖 Generated with Claude Code

The previous commit made diff_ignore_lineno() delete the two *_temp_diff
files it creates. That broke shell/_38_fig/cbrd_24478/deduplicate, whose
case CUBRID#7 asserts on one of them:

  compare_result_between_files create_table_data.log create_table_data.answer
  if [ -f create_table_data.answer_temp_diff ];then
      write_ok "[create table checked]"
  else
      write_nok "[create table fail]"
  fi

Once the function removed the file the condition was never true, so the
case wrote NOK and the test case failed.

Drop the removal and let diff be the last command again, so its exit code
stays the return value of the function without the 'rc' plumbing. The
temporary files are the test case's to clean up: of the 43 references to
'*_temp_diff' in the shell test cases, the one above reads the file and
the remaining 42 delete it at the end of the script, 13 of them with a
bare 'rm' that also fails once the glob matches nothing.

The Korean and English masking added in the previous commit is unchanged,
as are 'cp -f' and the quoted file names.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown

Reviews (1): Last reviewed commit: "[CUBRIDQA-1461] keep the diff_ignore_lin..." | Re-trigger Greptile

@swi0110
swi0110 requested a review from kwonhoil July 30, 2026 04:27
@swi0110
swi0110 merged commit 6c0dd46 into CUBRID:develop Jul 30, 2026
2 checks passed
@swi0110
swi0110 deleted the modify_init.sh_CUBRIDQA-1461 branch July 30, 2026 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants