Skip to content

Conversation

@avezey-ci
Copy link
Contributor

Summary

  • let the quick start resource override be set to 0 as described and avoid forcing a minimum
  • parse the override value safely and reuse it when computing quick start budgets

Testing

  • docker compose -f tools/headless_testing/docker-compose.yml build
  • docker compose -f tools/headless_testing/docker-compose.yml run --rm bar

@github-actions
Copy link
Contributor

github-actions bot commented Nov 19, 2025

Test Results

15 tests  +1   7 ✅ ±0   9s ⏱️ ±0s
 1 suites ±0   8 💤 +1 
 1 files   ±0   0 ❌ ±0 

Results for commit 5d8cfcc. ± Comparison against base commit ea60385.

♻️ This comment has been updated with latest results.

)
if not shouldRunGadget then return false end

local overrideQuickStartResources = tonumber(modOptions.override_quick_start_resources) or 0
Copy link
Member

Choose a reason for hiding this comment

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

Modoptions do not need type coercion of default value assignment, the game overrides Spring.GetModOptions() to do both these things.

@sprunk
Copy link
Collaborator

sprunk commented Nov 20, 2025

quick_start_range also seems to have a "0 for default" behaviour with a higher than zero minimum, might be worth handling it as well.

Edit: looks like that's #6269, sounds good then.

@sprunk
Copy link
Collaborator

sprunk commented Nov 20, 2025

As an aside,

Testing

  • docker compose -f tools/headless_testing/docker-compose.yml build
  • docker compose -f tools/headless_testing/docker-compose.yml run --rm bar

if people run these tests and think it makes the PR good then the tests are worse than worthless. They don't test anything useful so just provide a false sense of security.

@avezey-ci
Copy link
Contributor Author

@WatchTheFort I dropped the redundant tonumber(... ) or 0 and now rely on Spring.GetModOptions()’s default/coercion for override_quick_start_resources.

@sprunk I added a small LuaUI test (LuaUI/Tests/quick_start_resources.lua) to make sure quickStartBudgetBase uses the override when >0 and the default budget when 0/“default”. Ran it headless with the existing docker harness, both with override=0 and override=5000, and it passes. As you noted, the quick_start_range topic is tracked separately in #6269.

modoptions.lua Outdated
step = 1,
section = "options_extra",
hidden = true,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

some formatting problems here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops -- okay I fixed the indents on that one.

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.

4 participants