-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove production use of DatabaseConfigPersistence #19275
Conversation
7cf9a24
to
4437060
Compare
...rsistence/src/test/java/io/airbyte/config/persistence/BaseDatabaseConfigPersistenceTest.java
Outdated
Show resolved
Hide resolved
@@ -1,511 +0,0 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests in this class were moved into separate *PersistenceTest
(HealthCheckPersistenceTest.java
WorkspacePersistenceTest.java
, and ActorDefinitionPersistenceTest.java
). Also discovered we effective have no tests for the Actor resource.
import org.junit.jupiter.api.Test; | ||
|
||
/** | ||
* Unit test for the {@link DatabaseConfigPersistence#updateConnectorDefinitions} method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this code path wasn't actually used anymore, so these tests were for a dead code path.
...fig/config-persistence/src/test/java/io/airbyte/config/persistence/StatePersistenceTest.java
Outdated
Show resolved
Hide resolved
...nfig-persistence/src/test/java/io/airbyte/config/persistence/StreamResetPersistenceTest.java
Outdated
Show resolved
Hide resolved
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.ValueSource; | ||
|
||
class ActorDefinitionPersistenceTest extends BaseConfigDatabaseTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in this file:
- lift and shift of tests from
ConfigRepository
. - replace
ConfigPersistence
withConfigRepository
. - intentionally not changing any of the tests themselves.
import org.junit.jupiter.params.provider.ValueSource; | ||
|
||
@SuppressWarnings({"PMD.LongVariable", "PMD.AvoidInstantiatingObjectsInLoops"}) | ||
class WorkspacePersistenceTest extends BaseConfigDatabaseTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in this file:
- lift and shift of tests from
ConfigRepository
. - replace
ConfigPersistence
withConfigRepository
. - intentionally not changing any of the tests themselves.
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class HealthCheckPersistenceTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes in this file:
- lift and shift of tests from
ConfigRepository
. - intentionally not changing any of the tests themselves.
@@ -117,6 +119,11 @@ public void clearUnsupportedProtocolVersionFlag(final UUID actorDefinitionId, | |||
}); | |||
} | |||
|
|||
public List<StreamDescriptor> getAllStreamsForConnection(final UUID connectionId) throws ConfigNotFoundException, IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved from ConfigRepository
...ersistence/src/test/java/io/airbyte/config/persistence/ConfigRepositoryE2EReadWriteTest.java
Outdated
Show resolved
Hide resolved
...fig-persistence/src/test/java/io/airbyte/config/persistence/ActorDefinitionMigratorTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
71dac20
to
cd96123
Compare
f72bdc4
to
e99d447
Compare
wip add queries build, but lots of wips delete DatabaseConfigPersistence pmd fix build local -x test fix names port DatabaseConfigPersistenceTest tests to ActorDefinitionMigratorTest clean up ActorDefinitionMigratorTest add CRUD tests for standard sync clean up ConfigRepository
e99d447
to
95d881e
Compare
This reverts commit 2c5dabc.
This reverts commit 2c5dabc.
Depends on PR to add new db base test calss: #19640
What
DatabaseConfigPersistence
!!!How
ConfigRepository
ConfigPersistence
. Moved any relevant business logic tests that were hidden in there (which there were a few, which is kinda scary because those tests were testing the oldConfigPersistence
implementations and not the ones that are currently used) and moved them into appropriate classes.Future Work
ConfigRepositoryE2EReadWriteTest.java
- this class is a monster. Decided not to tackle it now, but as we split persistences and their tests by resource, we should pick at this. It basically has tests for CRUD operations for every single resource.Recommended reading order
ConfigRepository.java
ActorDefinitionMigratorTest.java
-- this is the one where there were a lot of test that got move to it from ConfigPersistence.WorkspacePeristenceTest.java
ActorDefinitionPersistenceTest.java
HealthCheckPersistenceTest.java
🚨 User Impact 🚨
This PR does move around a lot of the queries from the
ConfigPersistence
to theConfigRepository
. There is a lot of testing but it's not that methodical or perfect coverage. There is some risk here that there is some mistake in a query that isn't caught by testing.