Skip to content

tests: Add Fleet and FleetAutoscaler tests#27

Draft
NAME-ASHWANIYADAV wants to merge 3 commits into
agones-dev:mainfrom
NAME-ASHWANIYADAV:fix/fleet-autoscaler-tests
Draft

tests: Add Fleet and FleetAutoscaler tests#27
NAME-ASHWANIYADAV wants to merge 3 commits into
agones-dev:mainfrom
NAME-ASHWANIYADAV:fix/fleet-autoscaler-tests

Conversation

@NAME-ASHWANIYADAV

Copy link
Copy Markdown
Contributor

Draft — depends on #25 and #26. Will be marked ready for review after those PRs merge and this branch is rebased.

Type of change

  • 🐛 Bug fix
  • 🚀 New feature / enhancement
  • 📖 Documentation
  • 🧹 Refactoring / cleanup
  • ⚙️ CI / tooling
  • ⚠️ Breaking change

What this PR does

Adds comprehensive unit tests for the Fleet and FleetAutoscaler resource models using the Vitest infrastructure introduced in #26.

Fleet tests (30 tests):

  • scheduling, desiredReplicas, currentReplicas, allocatedReplicas, readyReplicas, reservedReplicas, strategy, maxSurge, maxUnavailable, allocationOverflow, priorities, counters, lists.

FleetAutoscaler tests (34 tests):

  • fleetName, policyType, bufferSize, minReplicas, maxReplicas, currentReplicas, desiredReplicas, ableToScale, scalingLimited, lastScaleTime, lastAppliedPolicy, syncInterval.
  • All policy types covered: Buffer, Webhook, Counter, List, Schedule (between + activePeriod), Wasm, Chain.

Did you use AI tools in preparing this PR?:
Y

Test plan

Automated checks

  • npm ci
  • npm run build
  • npm run tsc
  • npm run lint
  • npm run format -- --check
  • npm run test

All 121 tests pass across 5 test files (GameServer 29, Fleet 30, FleetAutoscaler 34, StateChip 13, buildAllocationBody 15).

Manual verification

N/A - unit tests only.

Notes for reviewers

All test data structures are verified against the upstream Agones Go structs (fleet.go, fleetautoscaler.go in agones-upstream/pkg/apis/agones/v1/).

Signed-off-by: ashwani yadav <22ashwaniyadav@gmail.com>
Signed-off-by: ashwani yadav <22ashwaniyadav@gmail.com>
Signed-off-by: ashwani yadav <22ashwaniyadav@gmail.com>
@NAME-ASHWANIYADAV NAME-ASHWANIYADAV marked this pull request as draft June 23, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant