aglinxinyuan opened a new pull request, #5659:
URL: https://github.com/apache/texera/pull/5659

   ### What changes were proposed in this PR?
   
   Pin behavior of `ConfigParserUtil.parseSizeStringToBytes` — the size-string 
parser used by `StorageConfig` for S3 multipart sizing. The `common/config` 
module had no test infrastructure before this PR (no `src/test` directory 
existed); this PR adds the directory and configures the standard ScalaTest 
dependency the way the other backend modules do.
   
   | Spec | Source class | Tests |
   | --- | --- | --- |
   | `ConfigParserUtilSpec` | `ConfigParserUtil` | 16 |
   
   Spec file name follows the `<srcClassName>Spec.scala` one-to-one convention.
   
   **Behavior pinned**
   
   | Surface | Contract |
   | --- | --- |
   | `1KB` / `1MB` / `1GB` | parses to `1024L` / `1024 * 1024L` / `1024 * 1024 
* 1024L` |
   | Multi-digit values (`100MB`, `1024KB`, `128GB`) | scales correctly by the 
unit multiplier |
   | `5GB` | preserves `Long` precision (result exceeds `Int.MaxValue`) |
   | `0010KB` | parses to `10 * 1024L` (decimal-only, no octal interpretation) |
   | Missing unit (`100`) | throws `IllegalArgumentException` with diagnostic |
   | Unsupported unit (`5TB`) | throws `IllegalArgumentException` |
   | Empty string | throws `IllegalArgumentException` |
   | Lowercase unit (`5mb`) | throws `IllegalArgumentException` (regex is 
anchored to `[KMG]B`) |
   | Embedded whitespace (`5 MB`) | throws `IllegalArgumentException` |
   | Non-numeric value (`abcMB`) | throws `IllegalArgumentException` |
   | Unit-only input (`MB`) | throws `IllegalArgumentException` |
   | Return type | `Long` (compile-time enforced) |
   
   **Build-config change**
   
   Adds `org.scalatest %% scalatest % 3.2.15 % Test` to 
`common/config/build.sbt`. The version matches the other backend modules 
(`common/workflow-operator`, `common/dao`, `amber`). Scope is `Test` so the 
dependency does not leak into the production classpath.
   
   ### Any related issues, documentation, discussions?
   
   Closes #5655.
   
   ### How was this PR tested?
   
   Pure unit-test addition (plus the build-config tweak above); verified 
locally with:
   
   - `sbt "Config/testOnly org.apache.texera.amber.util.ConfigParserUtilSpec"` 
— 16 tests, all green
   - `sbt scalafmtCheckAll` — clean
   - CI to confirm
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 4.7 [1M context])


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to