Skip to content

add unit test coverage for storage result + dataset model classes #5696

@aglinxinyuan

Description

@aglinxinyuan

Task Summary

Add dedicated unit-specs for three small storage-layer model classes in common/workflow-core/. Pin defaults, equality, and trait conformance so accidental drift in the result-store schema (tupleCount, changeDetector) or in the OnDataset accessor surface is caught early.

Background

Three small storage-layer model classes in common/workflow-core currently lack a dedicated unit-spec:

Source class Package Purpose
OperatorResultMetadata core/storage/result Per-operator result metadata: tupleCount: Int = 0, changeDetector: String = ""
WorkflowResultStore core/storage/result Map-wrapping case class: resultInfo: Map[OperatorIdentity, OperatorResultMetadata] = Map.empty
OnDataset core/storage/model Trait with getRepositoryName / getVersionHash / getFileRelativePath — accessor contract for dataset-backed documents

Behavior to pin

OperatorResultMetadata

Surface Contract
Default constructor OperatorResultMetadata() has tupleCount == 0 and changeDetector == ""
Custom values preserved via the case-class constructor
Equality case-class equality compares both fields
copy replaces only the field passed, preserves the rest

WorkflowResultStore

Surface Contract
Default constructor WorkflowResultStore() has resultInfo == Map.empty
Equality two stores with the same resultInfo are case-equal
copy replaces resultInfo
Map carrying multiple operator metadatas each key/value is preserved

OnDataset

Surface Contract
Trait declares three accessors getRepositoryName, getVersionHash, getFileRelativePath — all (): String
A test-only concrete subclass returns each accessor's value verbatim
Pattern matching a value of type OnDataset can be matched via type-test for cross-module dispatch

Scope

  • New spec files (one per source class per the spec-filename convention):
    • OperatorResultMetadataSpec.scala
    • WorkflowResultStoreSpec.scala
    • OnDatasetSpec.scala
  • No production-code changes.
  • OnDataset is a trait; exercise it through a minimal test-only concrete subclass.

Task Type

  • Refactor / Cleanup
  • DevOps / Deployment / CI
  • Testing / QA
  • Documentation
  • Performance
  • Other

Metadata

Metadata

Assignees

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions