Skip to content
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

fix: Draft PR to run tests for refactor commit log PR #1566

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/at_secondary_server/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ dependencies:
yaml: 3.1.2
logging: 1.2.0

dependency_overrides:
at_persistence_secondary_server:
git:
url: https://github.com/atsign-foundation/at_server.git
path: packages/at_persistence_secondary_server
ref: refactor_commit_log

dev_dependencies:
test: ^1.24.4
coverage: ^1.6.1
Expand Down
17 changes: 9 additions & 8 deletions packages/at_secondary_server/test/sync_unit_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@ void main() {
expect(atData.metaData!.version, 0);
expect(atData.metaData?.createdBy, atSign);
// verify commit entry data
CommitEntry? commitEntry = await atCommitLog!.getEntry(0);
expect(commitEntry!.operation, CommitOp.UPDATE);
expect(commitEntry.commitId, 0);
Iterator commitEntriesItr = atCommitLog!.getEntries(-1);
commitEntriesItr.moveNext();
expect(commitEntriesItr.current.value.operation, CommitOp.UPDATE);
expect(commitEntriesItr.current.value.commitId, 0);
expect(commitEntriesItr.moveNext(), false);
});

try {
Expand All @@ -121,12 +123,11 @@ void main() {
.getSecondaryKeyStore()
?.put('@alice:phone@alice', AtData()..data = '123');
// Assert commit entry before update
List<CommitEntry?> commitEntryListBeforeUpdate =
await atCommitLog!.getChanges(-1, '.*');
expect(commitEntryListBeforeUpdate.length, 1);
Iterator commitEntriesItr = atCommitLog!.getEntries(-1);
commitEntriesItr.moveNext();
expect(
commitEntryListBeforeUpdate.first!.atKey, '@alice:phone@alice');
expect(commitEntryListBeforeUpdate.first!.commitId, 0);
commitEntriesItr.current.value.atKey, '@alice:phone@alice');
expect(commitEntriesItr.current.value.commitId, 0);
// Update the same key again
var keyUpdateDateTime = DateTime.now().toUtc();
await secondaryPersistenceStore!.getSecondaryKeyStore()?.put(
Expand Down
7 changes: 7 additions & 0 deletions tests/at_end2end_test/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ dependencies:
ref: trunk
at_lookup: ^3.0.32

dependency_overrides:
at_persistence_secondary_server:
git:
url: https://github.com/atsign-foundation/at_server.git
path: packages/at_persistence_secondary_server
ref: refactor_commit_log

dev_dependencies:
lints: ^1.0.1
test: ^1.14.4
Expand Down
7 changes: 7 additions & 0 deletions tests/at_functional_test/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ dependencies:
uuid: ^3.0.7
elliptic: ^0.3.8

dependency_overrides:
at_persistence_secondary_server:
git:
url: https://github.com/atsign-foundation/at_server.git
path: packages/at_persistence_secondary_server
ref: refactor_commit_log

dev_dependencies:
lints: ^1.0.1
test: ^1.24.3
Expand Down