X Tutup
Skip to content

Tests/add disable stage tests#3045

Open
shawnmcmanus wants to merge 3 commits intoopenrocket:unstablefrom
shawnmcmanus:tests/add-disable-stage-tests
Open

Tests/add disable stage tests#3045
shawnmcmanus wants to merge 3 commits intoopenrocket:unstablefrom
shawnmcmanus:tests/add-disable-stage-tests

Conversation

@shawnmcmanus
Copy link

Closes #1693

Description

This is my first open source contribution, and I chose this issue because I have a personal interest in rocketry and wanted to contribute to a project I find genuinely exciting.

This PR adds deterministic unit tests for the disable-stage functionality in BarrowmanCalculatorTest.java and MassCalculatorTest.java, as suggested in issue #1693.

The existing DisableStageTest.java verifies disable-stage behavior through full simulations, which can occasionally produce flaky failures due to simulation inaccuracies. The new tests avoid this by asserting on analytical outputs instead:

  • BarrowmanCalculatorTest.testDisabledStageAerodynamics() — verifies that disabling the core and booster stages correctly reduces CNa, shifts the center of pressure forward, and that re-enabling all stages fully restores the original values
  • MassCalculatorTest.testDisabledStageMassAndCG() — verifies that disabling the core and booster stages correctly reduces structural mass, produces the expected center of gravity, and that re-enabling all stages fully restores the original values

Both tests use the existing Falcon 9 Heavy test rocket and its established constants, so the expected values are cross-validated against the existing test suite.

Testing

All existing tests in both BarrowmanCalculatorTest (20 tests) and MassCalculatorTest (33 tests) pass with the new additions included.

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.

Write unit tests for disable stage in BarrowmanCalculator and MassCalculatorTest

1 participant

X Tutup