sapling/tests/integration/test-admin-hg-sync-bundle-remains.t
Kostia Balytskyi 7afc953929 mononoke: allow tests to work with multiple mononoke repos
Reviewed By: farnz

Differential Revision: D17499277

fbshipit-source-id: 99c3e624cea855a6984b0a3c1d991d16e13c64a3
2019-09-23 07:16:15 -07:00

53 lines
2.7 KiB
Perl

$ . "${TEST_FIXTURES}/library.sh"
$ ZERO=0000000000000000000000000000000000000000000000000000000000000000
$ ONE=1111111111111111111111111111111111111111111111111111111111111111
$ TWO=2222222222222222222222222222222222222222222222222222222222222222
$ THREE=3333333333333333333333333333333333333333333333333333333333333333
setup configuration
$ ENABLE_PRESERVE_BUNDLE2=1 setup_common_config blob:files
$ create_books_sqlite3_db
$ write_stub_log_entry create "$ZERO"
$ write_stub_log_entry update "$ZERO" "$ONE"
$ write_stub_log_entry --blobimport update "$ONE" "$TWO"
$ write_stub_log_entry --blobimport update "$TWO" "$THREE"
$ sqlite3 "$TESTTMP/monsql/bookmarks" "select id, repo_id, hex(from_changeset_id), reason from bookmarks_update_log;"
1|0||testmove
2|0|0000000000000000000000000000000000000000000000000000000000000000|testmove
3|0|1111111111111111111111111111111111111111111111111111111111111111|blobimport
4|0|2222222222222222222222222222222222222222222222222222222222222222|blobimport
it should count remaining entries
$ mononoke_admin hg-sync-bundle last-processed --set 0
* Counter for RepositoryId(0) set to 0 (glob)
$ mononoke_admin hg-sync-bundle remains
* Remaining bundles to replay in RepositoryId(0): 4 (glob)
$ mononoke_admin hg-sync-bundle last-processed --set 1
* Counter for RepositoryId(0) set to 1 (glob)
$ mononoke_admin hg-sync-bundle remains
* Remaining bundles to replay in RepositoryId(0): 3 (glob)
$ mononoke_admin hg-sync-bundle last-processed --set 10
* Counter for RepositoryId(0) set to 10 (glob)
$ mononoke_admin hg-sync-bundle remains
* Remaining bundles to replay in RepositoryId(0): 0 (glob)
it should count remaining entries excluding blobimport
$ mononoke_admin hg-sync-bundle last-processed --set 0
* Counter for RepositoryId(0) set to 0 (glob)
$ mononoke_admin hg-sync-bundle remains --without-blobimport
* Remaining non-blobimport bundles to replay in RepositoryId(0): 2 (glob)
$ mononoke_admin hg-sync-bundle last-processed --set 1
* Counter for RepositoryId(0) set to 1 (glob)
$ mononoke_admin hg-sync-bundle remains --without-blobimport
* Remaining non-blobimport bundles to replay in RepositoryId(0): 1 (glob)
$ mononoke_admin hg-sync-bundle last-processed --set 10
* Counter for RepositoryId(0) set to 10 (glob)
$ mononoke_admin hg-sync-bundle remains --without-blobimport
* Remaining non-blobimport bundles to replay in RepositoryId(0): 0 (glob)
it should support --quiet
$ mononoke_admin hg-sync-bundle last-processed --set 0
* Counter for RepositoryId(0) set to 0 (glob)
$ mononoke_admin hg-sync-bundle remains --quiet
4
$ mononoke_admin hg-sync-bundle remains --quiet --without-blobimport
2