sapling/eden/mononoke/tests/integration/test-admin-hg-sync-bundle-remains.t
Lukasz Piatkowski e8d62b64d5 mononoke: move the codebase under eden/ directory
fbshipit-source-id: 43a0252cb3ec42aa365f20d1b6faa4d24d74c9b8
2020-02-06 13:46:04 +01:00

59 lines
2.9 KiB
Perl

# Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License found in the LICENSE file in the root
# directory of this source tree.
$ . "${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/sqlite_dbs" "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