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

   ### What changes were proposed in this PR?
   
   `TexeraWebApplication` had no spec and sat at **0% of 76 lines**. It 
assembles the public web service — the asset bundle serving the built frontend, 
the collaboration websocket endpoint, the CORS and cache-control filters, the 
request log, and the 404-to-index rule behind Angular's deep links — and none 
of it was verified.
   
   Adds 14 tests, taking it to **88.2% of lines** (67/76). `initialize()` and 
`run()` are driven against a real Dropwizard `Environment`, and every assertion 
inspects the wiring they leave behind.
   
   ### Verification
   
   28 mutations applied and reverted, production diff empty each time.
   
   **Reviewing the tests then found two that claimed more than they pinned**, 
which is the part worth reading:
   
   | Weakness | Why it passed | Fix |
   |---|---|---|
   | the asset test asserted only the servlet mapping | `FileAssetsBundle` 
takes three arguments and only the uriPath was observed — point it at a 
directory that does not exist and the servlet is still registered at `/*`, it 
just serves nothing, while the test's name claims it serves the frontend from 
the filesystem | assert `getIndexFile`, and read `resourcePath` reflectively |
   | both request-log tests pinned the guard, not the level | move the emission 
to WARN and both still pass: at INFO the guard holds and the appender collects 
an identical line, at WARN the guard stops it and the suppression test still 
sees nothing | the helper now returns the logging events, and the test asserts 
`Level.INFO` |
   
   Three mutations confirm the fixes: a missing asset directory, a different 
index file, and the access line emitted at WARN — all red, where the first two 
and the level were green before.
   
   ### Deliberately not included
   
   - **`main()`** binds a port; **one unused logger** is the other uncovered 
line.
   - **The ordering of `chain.doFilter` against the logging block.** In 
production, moving it would make every access line report a status that has not 
been written yet — but the fixture's response is a `java.lang.reflect.Proxy` 
answering `getStatus` with a constant, so no assertion built on it can see the 
difference. Recorded rather than papered over with a test that cannot fail.
   
   No production file is touched.
   
   ### Any related issues, documentation, discussions?
   
   Closes #7614
   
   ### How was this PR tested?
   
   ```
   STORAGE_ICEBERG_CATALOG_TYPE=postgres sbt "WorkflowExecutionService/testOnly 
org.apache.texera.web.TexeraWebApplicationSpec"
   ```
   
   ```
   [info] Total number of tests run: 14
   [info] Tests: succeeded 14, failed 0, canceled 0, ignored 0, pending 0
   ```
   
   `Test/scalafmtCheck` and `Test/scalafix --check` both pass.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 5)
   


-- 
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