Skip to content

refactor: 확장자를 직접 입력받도록 수정

d330ae9
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

@patchlogr/cli 패키지를 위한 diff 커맨드 추가 #30

refactor: 확장자를 직접 입력받도록 수정
d330ae9
Select commit
Loading
Failed to load commit list.
GitHub Actions / Test Logs succeeded Feb 22, 2026 in 0s

109 passed, 0 failed and 0 skipped

Tests passed successfully

Report Passed Failed Skipped Time
packages/patchlogr-adapter-oas/.coverage/report.xml 60✅ 2s
packages/patchlogr-cli/.coverage/report.xml 1✅ 3ms
packages/patchlogr-core/.coverage/report.xml 48✅ 207ms

✅ packages/patchlogr-adapter-oas/.coverage/report.xml

60 tests were completed in 2s with 60 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
src/tests/preprocessOASDocument.test.ts 2✅ 810ms
src/oas-common/oasVersionUtils.test.ts 5✅ 7ms
src/oas-common/schemaGuards.test.ts 3✅ 4ms
src/oas-common/toCanonicalSchema.test.ts 4✅ 15ms
src/oas-pipeline/tests/OASBundleStage.test.ts 1✅ 21ms
src/oas-pipeline/tests/OASDereferenceStage.test.ts 1✅ 6ms
src/oas-pipeline/tests/OASValidationStage.test.ts 7✅ 1s
src/oas-pipeline/tests/PipelineExecutor.test.ts 2✅ 6ms
src/oas-v2/canonicalizeOASV2.test.ts 8✅ 18ms
src/oas-v2/partitionParameters.test.ts 1✅ 8ms
src/oas-v2/toCanonicalOperationDoc.test.ts 1✅ 5ms
src/oas-v2/toCanonicalParam.test.ts 2✅ 7ms
src/oas-v2/toCanonicalRequestBody.test.ts 3✅ 8ms
src/oas-v2/toCanonicalResponse.test.ts 1✅ 6ms
src/oas-v2/toCanonicalSchema.test.ts 3✅ 6ms
src/oas-v3/canonicalizeOASV3.test.ts 8✅ 24ms
src/oas-v3/toCanonicalOperationDoc.test.ts 1✅ 5ms
src/oas-v3/toCanonicalParams.test.ts 1✅ 6ms
src/oas-v3/toCanonicalRequestBody.test.ts 1✅ 5ms
src/oas-v3/toCanonicalResponse.test.ts 1✅ 4ms
src/oas-v3/toCanonicalSchema.test.ts 4✅ 6ms

✅ src/tests/preprocessOASDocument.test.ts

✅ preprocessOASDocument Integration > OAS 2.0 문서를 canonical spec으로 변환한다
✅ preprocessOASDocument Integration > OAS 3.0 문서를 canonical spec으로 변환한다

✅ src/oas-common/oasVersionUtils.test.ts

✅ OASVersionUtils > getOASVersion returns correct version for 3.+
✅ OASVersionUtils > getOASVersion 는 2.0 버전을 반환한다
✅ OASVersionUtils > getOASVersion 은 unknown 버전을 반환한다
✅ OASVersionUtils > isOpenAPIV3 should correctly identify OpenAPI v3 documents
✅ OASVersionUtils > isOpenAPIV2 should correctly identify OpenAPI v2 documents

✅ src/oas-common/schemaGuards.test.ts

✅ Guards > isSchemaObject > 스키마 객체에 대해 true 를 반환한다
✅ Guards > isSchemaObject > 참조 객체에 대해 false 를 반환한다
✅ Guards > isSchemaObject > null에 대해 false 를 반환한다

✅ src/oas-common/toCanonicalSchema.test.ts

✅ toCanonicalSchema > schema를 canonical schema로 변환한다
✅ toCanonicalSchema > nested properties를 canonical schema로 변환한다
✅ toCanonicalSchema > nested arrays를 canonical schema로 변환한다
✅ toCanonicalSchema > tuple items (array of schemas)를 canonical schema로 변환한다

✅ src/oas-pipeline/tests/OASBundleStage.test.ts

✅ OASBundleStage > external $ref를 dereference한다

✅ src/oas-pipeline/tests/OASDereferenceStage.test.ts

✅ OASDereferenceStage > input.oas가 없으면 에러를 던진다

✅ src/oas-pipeline/tests/OASValidationStage.test.ts

✅ SwaggerValidationStage > 3.0.x 버전을 파싱한다
✅ SwaggerValidationStage > 2.0 버전을 파싱한다
✅ SwaggerValidationStage > 3.1 버전을 파싱한다
✅ SwaggerValidationStage > 올바른 OAS 문서를 검증한다
✅ SwaggerValidationStage > 올바르지 않은 OAS 문서를 검증한다
✅ SwaggerValidationStage > input.oas가 없으면 에러를 던진다
✅ SwaggerValidationStage > 검증된 oas object를 context에 업데이트한다

✅ src/oas-pipeline/tests/PipelineExecutor.test.ts

✅ PipelineExecutor > stages 들을 올바르게 추가한다
✅ PipelineExecutor > stages를 올바른 순서로 실행한다

✅ src/oas-v2/canonicalizeOASV2.test.ts

✅ canonicalizeOASV2 > 'info' 를 올바르게 매핑한다
✅ canonicalizeOASV2 > 올바른 operation 키를 생성한다
✅ canonicalizeOASV2 > path-level 및 operation-level parameter를 병합한다
✅ canonicalizeOASV2 > body parameter를 올바르게 변환한다
✅ canonicalizeOASV2 > formData를 올바른 content-type으로 body로 변환한다
✅ canonicalizeOASV2 > 응답과 produces를 올바르게 매핑한다
✅ canonicalizeOASV2 > operation 메타데이터를 올바르게 매핑한다
✅ canonicalizeOASV2 > 전체 canonical spec을 올바르게 생성한다

✅ src/oas-v2/partitionParameters.test.ts

✅ partitionParameters > 요청 파라미터, form data, body 파라미터를 분리한다

✅ src/oas-v2/toCanonicalOperationDoc.test.ts

✅ toCanonicalOperationDoc > 문서 메타데이터를 CanonicalOperationDoc으로 변환한다

✅ src/oas-v2/toCanonicalParam.test.ts

✅ toCanonicalParam > 일반 파라미터를 CanonicalParam으로 변환한다
✅ toCanonicalParam > array 타입의 파라미터에 collectionFormat을 포함한다

✅ src/oas-v2/toCanonicalRequestBody.test.ts

✅ toCanonicalBody > body 파라미터를 CanonicalBody로 변환한다
✅ toCanonicalBody > form data를 CanonicalBody로 변환한다
✅ toCanonicalBody > form data의 추가 프로퍼티 (default, enum)을 유지하고 items를 정규화한다

✅ src/oas-v2/toCanonicalResponse.test.ts

✅ toCanonicalResponses > 응답을 CanonicalResponse로 변환한다

✅ src/oas-v2/toCanonicalSchema.test.ts

✅ toCanonicalSchema > string schema를 canonical schema로 변환한다
✅ toCanonicalSchema > required fields를 canonical schema로 변환한다
✅ toCanonicalSchema > nullable을 canonical schema로 변환한다

✅ src/oas-v3/canonicalizeOASV3.test.ts

✅ canonicalizeOASV3 > info 프로퍼티를 올바르게 매핑한다
✅ canonicalizeOASV3 > operation 키를 올바르게 생성한다
✅ canonicalizeOASV3 > path-level과 operation-level 파라미터를 병합한다
✅ canonicalizeOASV3 > body 파라미터를 올바르게 변환한다
✅ canonicalizeOASV3 > multipart/form-data를 body로 변환한다
✅ canonicalizeOASV3 > 응답과 dereference 로직을 매핑한다
✅ canonicalizeOASV3 > operation 메타데이터를 매핑한다
✅ canonicalizeOASV3 > 전체 canonical spec을 생성한다

✅ src/oas-v3/toCanonicalOperationDoc.test.ts

✅ toCanonicalOperationDoc > 문서 메타데이터를 CanonicalOperationDoc으로 변환한다

✅ src/oas-v3/toCanonicalParams.test.ts

✅ toCanonicalParams > 파라미터를 CanonicalParam 배열로 변환한다

✅ src/oas-v3/toCanonicalRequestBody.test.ts

✅ toCanonicalBody > request body를 CanonicalBody로 변환한다

✅ src/oas-v3/toCanonicalResponse.test.ts

✅ toCanonicalResponses > 응답을 CanonicalResponse로 변환한다

✅ src/oas-v3/toCanonicalSchema.test.ts

✅ toCanonicalSchema > string schema를 canonical schema로 변환한다
✅ toCanonicalSchema > required fields를 canonical schema로 변환한다
✅ toCanonicalSchema > missing type을 canonical schema로 변환한다
✅ toCanonicalSchema > nullable을 canonical schema로 변환한다

✅ packages/patchlogr-cli/.coverage/report.xml

1 tests were completed in 3ms with 1 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
src/tests/sample.test.ts 1✅ 3ms

✅ src/tests/sample.test.ts

✅ @patchlogr/cli > sample test

✅ packages/patchlogr-core/.coverage/report.xml

48 tests were completed in 207ms with 48 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
src/diff/tests/detectVersionBump.test.ts 8✅ 11ms
src/diff/tests/diffChildNodes.test.ts 8✅ 39ms
src/diff/tests/diffLeafNodes.test.ts 2✅ 6ms
src/diff/tests/diffNode.test.ts 15✅ 42ms
src/diff/tests/diffTypeChange.test.ts 3✅ 29ms
src/partition/tests/partitionByMethod.test.ts 5✅ 37ms
src/partition/tests/partitionByTag.test.ts 6✅ 37ms
src/utils/tests/createHash.test.ts 1✅ 6ms

✅ src/diff/tests/detectVersionBump.test.ts

✅ detectVersionBump > none > 변경사항이 없으면 none을 반환한다
✅ detectVersionBump > major (breaking changes) > removed 타입은 major를 반환한다
✅ detectVersionBump > major (breaking changes) > type_changed는 major를 반환한다
✅ detectVersionBump > minor > added 타입은 minor를 반환한다
✅ detectVersionBump > minor > modified 타입은 minor를 반환한다
✅ detectVersionBump > patch > 알 수 없는 타입은 patch를 반환한다
✅ detectVersionBump > version bump 우선순위 > major > minor: major가 있으면 major를 반환한다
✅ detectVersionBump > version bump 우선순위 > reasons에는 해당 레벨의 모든 변경 이유가 포함된다

✅ src/diff/tests/diffChildNodes.test.ts

✅ diffChildNodes > removed detection (base에만 존재) > base에만 있는 leaf child는 removed로 감지
✅ diffChildNodes > removed detection (base에만 존재) > base에만 있는 node child는 removed로 감지 (서브트리)
✅ diffChildNodes > added detection (head에만 존재) > head에만 있는 leaf child는 added로 감지
✅ diffChildNodes > added detection (head에만 존재) > head에만 있는 node child는 added로 감지 (서브트리)
✅ diffChildNodes > modifiedPairs (공통 자식 중 hash가 다른 경우) > 공통 자식의 hash가 다르면 modifiedPairs에 포함
✅ diffChildNodes > modifiedPairs (공통 자식 중 hash가 다른 경우) > 공통 자식의 hash가 같으면 modifiedPairs에 포함되지 않음
✅ diffChildNodes > 복합 시나리오 > added, removed, modified가 동시에 존재하는 경우
✅ diffChildNodes > 복합 시나리오 > 빈 children을 가진 node들 비교

✅ src/diff/tests/diffLeafNodes.test.ts

✅ diffLeafNodes > 두 leaf의 hash가 다른 경우 modified change 생성
✅ diffLeafNodes > path는 전달받은 그대로 사용

✅ src/diff/tests/diffNode.test.ts

✅ diffNode > base.hash === head.hash인 경우 changes는 빈 배열이어야 함
✅ diffNode > base와 head가 둘 다 leaf이고 hash가 다른 경우 modified 1건
✅ diffNode > base와 head가 둘 다 node이고 hash가 다른 경우 children을 key 기준으로 비교
✅ diffNode > base에만 있는 childKey가 존재하는 경우 removed 1건
✅ diffNode > head에만 있는 childKey가 존재하는 경우 added 1건
✅ diffNode > base와 head 모두에 있는 childKey인데 child hash가 같은 경우 탐색하지 않음
✅ diffNode > base와 head 모두에 있는 childKey인데 child hash가 다른 경우 재귀
✅ diffNode > base에만 있는 child가 node(subtree)인 경우 removed는 1건이어야 함
✅ diffNode > head에만 있는 child가 node(subtree)인 경우 added는 1건이어야 함
✅ diffNode > base가 node이고 head가 leaf인 경우 type_changed 1건
✅ diffNode > base가 leaf이고 head가 node인 경우 type_changed 1건
✅ path / key > 모든 change에는 path가 있어야 함 (root부터 변화 노드까지)
✅ path / key > change.key는 path의 마지막 요소와 동일해야 함
✅ path / key > 동일한 path/key에 대해 change가 중복 생성되면 안 됨
✅ path / key > baseHash/headHash 필드는 일관돼야 함

✅ src/diff/tests/diffTypeChange.test.ts

✅ diffTypeChange > node -> leaf 타입 변경 시 type_changed 생성
✅ diffTypeChange > leaf -> node 타입 변경 시 type_changed 생성
✅ diffTypeChange > path는 전달받은 그대로 사용

✅ src/partition/tests/partitionByMethod.test.ts

✅ partitionByMethod > HTTPMethod 를 기준으로 파티셔닝 한다
✅ partitionByMethod > 여러 HTTPMethod 를 기준으로 파티셔닝 한다
✅ partitionByMethod > hashObjects를 리턴한다
✅ partitionByMethod > 리프노드에는 value가 포함되지 않는다
✅ partitionByMethod > hashObjects에 리프노드에 대한 CanonicalOperation 이 매핑된다

✅ src/partition/tests/partitionByTag.test.ts

✅ partitionByTag > 첫 번째 tag를 기준으로 파티셔닝 한다
✅ partitionByTag > 여러 tag를 기준으로 파티셔닝 한다
✅ partitionByTag > tag가 없는 경우 default tag로 파티셔닝 한다
✅ partitionByTag > hashObjects를 리턴한다
✅ partitionByTag > 리프노드에는 value가 포함되지 않는다
✅ partitionByTag > hashObjects에 리프노드에 대한 CanonicalOperation 이 매핑된다

✅ src/utils/tests/createHash.test.ts

✅ createHash > createSHA256Hash > sha256 hash 는 동일한 입력에 대해 동일한 결과를 반환한다