Repository navigation
Conversation
|
Pinging @elastic/elastic-agent (Team:Elastic-Agent) |
…-state-store-migration-tests
…ersonQ/elastic-agent into 3912-add-state-store-migration-tests
…e-migration-tests
…-state-store-migration-tests
…ersonQ/elastic-agent into 3912-add-state-store-migration-tests
8d69a4e to
ea73ae9
Compare
It's needed so we can set the encrypted store vault's path
|
pchila
left a comment
There was a problem hiding this comment.
Code looks reasonable, I am a bit surprised by the 0% new code coverage... are the tests actually running?
Moreover, I think that there's a bit of overlap with a bugfix I merged last year where I was moving unencrypted config to the new encrypted diskstores (as the agent was "forgetting" fleet config because fleet.enc was not found), so maybe we need to clean up a bit. Here's where the bugfix is located
elastic-agent/internal/pkg/agent/cmd/run.go
Lines 194 to 206 in bdefb2c
the new code is test code, which isn't covered by tests. I don't think it's calculating the overall coverage. |
As Sonarqube looks for coverage only on NEW code and all the new code is test code, it isn't calculating the overall code coverage increase. Here it's:
@pchila here it is, a 14% increase in code coverage |
@pchila, good point, it might be messing the store migration. I added a TODO on my currently WIP PR: 4926df0 |
Fix action store -> state store migration tests (#4235) * use golden file for store migration test * remove withFile function * migrate take in a storage.Store instead of the storage's path. It's needed so we can set the encrypted store vault's path refactor state store (#4253) It modifies the state store API to match the current needs. update action model to match fleet-server schema (#4240) * simplify fleetapi.Actions.UnmarshalJSON * add test to ensure the state store is correctly loaded from disk * skip state store migration tests, they will be fixes on a follow-up PR as part of #3912 add migrations for action and state stores (#4305)

0.0% Coverage on New Code
What does this PR do?
Fixes the state store migration tests so they actually run and skip them for darwin.
It also changes the migration test to use a golden file when testing the migration from the old action store to the new state store.
Finally, it removes the
withFilefunction as its miss usage caused the store migration tests to not actually run.Why is it important?
error parsing version ""if agent restarts before the upgrade starts #3912, the test would still pass. However the actual migration would not work as expected.Checklist
[ ] I have commented my code, particularly in hard-to-understand areas[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files[ ] I have added an entry in./changelog/fragmentsusing the changelog tool[ ] I have added an integration test or an E2E testRelated issues
error parsing version ""if agent restarts before the upgrade starts #3912Questions to ask yourself