Skip to content

Fix test: Remove expectation for isCompact from MapPlaylistOvertime test - #5467

Merged
FloPinguin merged 2 commits into
mainfrom
Fix-MapPlaylistOvertime-testerror
Sep 16, 2026
Merged

FloPinguin merged 2 commits into
mainfrom
Fix-MapPlaylistOvertime-testerror

Conversation

@VariableVince

Copy link
Copy Markdown
Contributor

Description:

Remove expectation for isCompact from the first test since we're only testing overtime here, so it has no place. The other two tests don't check isCompact either and rightfully so.

The check caused errors because isCompact can sometimes be true, it's not always undefined. But moreover the check isn't needed here.

Error example: https://github.com/openfrontio/OpenFrontIO/actions/runs/35058498685/job/104673606508?pr=5461

Reported here: https://discord.com/channels/1359946986937258015/1450487807242932336/1549654553735991316

Please complete the following:

  • I have added screenshots for all UI updates
  • I process any text displayed to the user through translateText() and I've added it to the en.json file
  • I have added relevant tests to the test directory

Please put your Discord username so you can be contacted if a bug or regression is found:

tryout33

Remove expectation for isCompact from the first test since we're only testing overtime here, so it has no place. The other two tests don't check isCompact either and rightfully so. 

The check caused errors because isCompact can sometimes be true, it's not always undefined. But moreover the check isn't needed here.
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 9d50aaec-2aba-481e-b254-022a8a460c43

📥 Commits

Reviewing files that changed from the base of the PR and between e626aba and 0fe5ccc.

📒 Files selected for processing (1)
  • tests/server/MapPlaylistOvertime.test.ts
💤 Files with no reviewable changes (1)
  • tests/server/MapPlaylistOvertime.test.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


Walkthrough

The FFA lobby test removes the assertion for config.publicGameModifiers. Its game mode, overtime, and schema validation assertions remain unchanged.

Changes

FFA test update

Layer / File(s) Summary
Update FFA lobby assertions
tests/server/MapPlaylistOvertime.test.ts
Removes the equality assertion for config.publicGameModifiers. Existing game mode, overtime, and schema validation assertions remain.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Other

Suggested reviewers: evanpelle

Merge Risk: ⚪ Minimal · up to 0fe5c

The test now avoids an invalid compact-map expectation without removing coverage for overtime behavior.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: removing the isCompact expectation from the MapPlaylistOvertime test.
Description check ✅ Passed The description directly explains why the isCompact expectation was removed and relates the change to the test behavior and reported error.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

One check leaves the FFA scene
The other checks stay sharp and clean
Overtime still holds its place
Schema guards the test case
A smaller test now runs with grace

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

🤖 Claude Code Review

Verdict: Approve — no issues found. Findings: 0 critical, 0 major, 0 minor.

This PR removes a single non-deterministic assertion (expect(config.publicGameModifiers).toEqual({ isCompact: undefined })) from tests/server/MapPlaylistOvertime.test.ts. isCompact is derived from playlists[type].length % 3 === 0 || undefined in src/server/MapPlaylist.ts, so it isn't always undefined — the removed assertion was incorrect and unrelated to the test's stated purpose (verifying overtime is always enabled in FFA lobbies), which remains covered by the retained overtime and schema-validation assertions.

Checked for:

  • CLAUDE.md compliance (two independent passes) — no violations; not a src/core change, doesn't touch the setup()/mocking testing pattern, no i18n/UI text involved.
  • Bugs and logic errors (two independent passes) — none; no unused imports, no broken assertions, no masking of a real underlying bug.

No inline comments to post.

@VariableVince

Copy link
Copy Markdown
Contributor Author

Please ignore the error from Deploy: the branch deployment is succesfully up and running. And the error doesn't come from this PR's contents. I've made a comment about it here: https://discord.com/channels/1359946986937258015/1381299816612495360/1549790538666872853

But again this Deploy error can be safely ignored!

Celant added a commit that referenced this pull request Sep 16, 2026
## Problem

A mixed-case branch name (`Fix-MapPlaylistOvertime-testerror`, [run
35103862692](https://github.com/openfrontio/OpenFrontIO/actions/runs/35103862692/job/104819884804?pr=5467),
PR #5467) became a mixed-case subdomain, because the sanitizing step in
`deploy.yml` and the check in `deploy.sh` both allow `A-Z`.

`update.sh` then sent
`site=Fix-MapPlaylistOvertime-testerror.openfront.dev` to
`/cluster/latest`. The API's site schema only accepts lowercase
(`^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$`), so it returned `400 Invalid
site`, and with `CLUSTER_STATE_SOURCE=api` the deploy failed. The
container was up, but server check-in sends the same site name and is
rejected too. Browsers also lowercase the page host, so the preview
couldn't list its server either way.

## Fix

- `deploy.yml`: lowercase the raw subdomain before the rest of the
sanitizing. It's treated as a canonical mapping (like `_` and `/` →
`-`), so it doesn't add the collision digest: `Fix-Foo` deploys to
`fix-foo`, the same host DNS would resolve anyway.
- `deploy.sh`: lowercase `SUBDOMAIN` too (matching how `HOST` is already
handled) so manual runs are covered, and tighten the label check to
`[a-z0-9-]`.

## Testing

- Ran the new sanitizing pipeline locally and under GNU `tr`
(ubuntu:24.04): `Fix-MapPlaylistOvertime-testerror` →
`fix-mapplaylistovertime-testerror`; `Fix/Map_X` → `fix-map-x`;
`Feat/Héllo_x` still drops the `é` and gets the digest.
- `bash -n deploy.sh`.

After merge, affected PR branches need a rebase/re-run. They will move
to the lowercase host, and the old uppercase container stays on the
staging box until someone removes it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@openfrontio
openfrontio Bot had a problem deploying to staging September 16, 2026 15:21 Failure
@github-actions

Copy link
Copy Markdown

🤖 Claude Code Review

Verdict: LGTM — no issues found. Findings: 0 blocking, 0 major, 0 minor.

This PR removes a single flaky assertion (expect(config.publicGameModifiers).toEqual({ isCompact: undefined })) from tests/server/MapPlaylistOvertime.test.ts, which is scoped to testing overtime behavior only.

Verified:

  • In src/server/MapPlaylist.ts, isCompact is derived non-deterministically and can legitimately be true for FFA configs, so the removed assertion was a genuine source of flakiness, not a meaningful invariant check.
  • config.overtime for FFA mode is set unconditionally and independently of isCompact, so no coverage of the test's actual subject (overtime behavior) is lost.
  • No unused imports or broken test structure introduced; the remaining assertions (gameMode, overtime, schema validity) still fully cover the test's stated purpose.
  • No CLAUDE.md violations — this is a test-only change with no src/core/ changes, no user-visible text, and no CDN/schema/build implications.

No issues found. Checked for bugs and CLAUDE.md compliance.

@FloPinguin FloPinguin added this to the v35 milestone Sep 16, 2026

@FloPinguin FloPinguin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@github-project-automation github-project-automation Bot moved this from Triage to Final Review in OpenFront Release Management Sep 16, 2026
@FloPinguin
FloPinguin merged commit ebe3112 into main Sep 16, 2026
16 of 17 checks passed
@FloPinguin
FloPinguin deleted the Fix-MapPlaylistOvertime-testerror branch September 16, 2026 15:46
@github-project-automation github-project-automation Bot moved this from Final Review to Complete in OpenFront Release Management Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

2 participants