Add feature toggle tests that read from actual configuration files#130
Merged
Add feature toggle tests that read from actual configuration files#130
Conversation
…o systems Co-authored-by: MaksyKun <77341370+MaksyKun@users.noreply.github.com>
Co-authored-by: MaksyKun <77341370+MaksyKun@users.noreply.github.com>
Co-authored-by: MaksyKun <77341370+MaksyKun@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add tests for enabling and disabling features
Add comprehensive feature toggle tests for all systems
Nov 16, 2025
Contributor
|
@copilot The tests look like pseudos without real database reading. Please make them use exactly the correct methods and read from the config |
- Updated TestBase to load plugin for config access - Rewritten all feature toggle tests to use actual config methods - Tests now call QuickStocksPlugin.getMarketCfg().isEnabled() etc. - Tests read from market.yml, companies.yml config files - Reduced test count from 110 to focused 43 tests that validate actual behavior - Each test uses assumeFalse(pluginLoadFailed) to skip if plugin can't load - Tests verify default values match YAML file settings Co-authored-by: MaksyKun <77341370+MaksyKun@users.noreply.github.com>
Contributor
Author
Updated in commit 106b327. Tests now:
Example: MarketCfg marketCfg = QuickStocksPlugin.getMarketCfg();
assertTrue(marketCfg.isEnabled(), "Market should be enabled per market.yml");All 43 tests now read directly from configuration instead of using pseudo-code. |
Copilot
AI
changed the title
Add comprehensive feature toggle tests for all systems
Add feature toggle tests that read from actual configuration files
Nov 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue requested tests validating enable/disable behavior for all features. Tests now read from actual configuration files instead of using pseudo-code.
Changes
Added 43 tests across 5 test classes that read from actual config files:
Core Systems
Test Coverage
QuickStocksPlugin.getMarketCfg().isEnabled(), etc.companies.enabledANDcrypto.enabled)Test Pattern
Tests load the plugin via MockBukkit and read from actual configuration:
Files
MarketFeatureToggleTest.java- 11 tests reading frommarket.ymlCompanyFeatureToggleTest.java- 10 tests reading fromcompanies.ymlCryptoFeatureToggleTest.java- 12 tests reading frommarket.ymlFeatureToggleIntegrationTest.java- 6 tests validating cross-feature dependenciesCommandFeatureToggleTest.java- 6 tests validating command config checksTestBase.java- Updated to load plugin for config accessFEATURE_TOGGLE_TESTING.md- Testing guide with dependency matrix and configuration examplesDefault Values Validated
Tests validate these actual values from YAML files:
market.enabled: true(from market.yml)market.features.watchlist: true(from market.yml)market.features.marketDevice: false(from market.yml)companies.enabled: true(from companies.yml)companies.plots.enabled: true(from companies.yml)crypto.enabled: false(from market.yml)crypto.personal.enabled: false(from market.yml)Feature Dependencies Validated
Tests follow existing Given-When-Then pattern, extend
TestBase, use JUnit 5. Tests read from actual configuration files usingQuickStocksPlugin.getXxxCfg()methods. Total project tests: 121 (78 existing + 43 new).Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.