Commit Graph

11 Commits

Author SHA1 Message Date
Saurabh Singh
e50c916cc3 tests: refactor scripts for connecting to the database
Summary:
There is redundant code in the codebase relating to fetching
configuration for database for the purpose of testing. This commit refactors
some code which enables removing the redundant code.

Reviewed By: quark-zju

Differential Revision: D8961806

fbshipit-source-id: f673bfffb80304d98987c9727f6e709fdb742813
2018-07-23 18:53:14 -07:00
Mark Thomas
5180dd5cf2 infinitepush: split backups into infinitepushbackup extension
Summary:
Split the infinitepush backups code into a separate module.

The infinitepush extension is responsible for providing scratch pushes, as well
as the server-side implementation for storing scratch bundles.

The infinitepushbackup extension uses this feature to provide automatic backup
support.  It is an alternative to the commitcloud extension, and the two will
be mutually exclusive.

Reviewed By: DurhamG

Differential Revision: D8204418

fbshipit-source-id: 9279c426da35d451a5e7b39a72f2c91d364e3fd4
2018-06-05 04:36:06 -07:00
Mark Thomas
63dcc1c97e infinitepush: enable commitcloud extension in infinitepush tests
Summary:
We broke infinitepush with a commitcloud change.  This would have been caught
if we had the commitcloud extension enabled during the infinitepush tests.

Differential Revision: D8257849

fbshipit-source-id: 8a0da2e3268a9545502d432fcbce4b4c1eae5bcb
2018-06-04 11:19:09 -07:00
Mateusz Moneta
4cfb665650 Update markers during hg pullbackup
Summary:
Before this change `hg pullbackup` did not set correct markers on commits.

This change make possible to see what changes already landed even when we are restoring repository from backup.
Before the change `fbclone` + `hg pullbackup` of repo with `C1` commit landed would result in:
```
o  o C2
|    |
o  o C1
|  /
|
o
```
after:
```
o  o C2
|    |
o  x C1
|  /
|
o
```

Reviewed By: StanislavGlebik

Differential Revision: D7032572

fbshipit-source-id: ffee3c7cc23c24a3df9a89c999c9dd2de226dbff
2018-04-13 21:51:23 -07:00
Kostia Balytskyi
174c81d3c9 hg: remove -r option from sed call as it is not supported by OSX
Summary:
`-r` seems to be unneeded, as tests pass without it.

Also, it does not look like the regex itself uses anything not mentioned in `man re_format` on OSX, so we can just use the non-extended re.

Reviewed By: StanislavGlebik

Differential Revision: D7167503

fbshipit-source-id: 3c5c520e9bf2627523cabc771226fc37dc2e9171
2018-04-13 21:51:22 -07:00
Aida Getoeva
93252b7fd2 Enable batch mode for SSH during background pushbackup
Summary:
Added passing BatchMode option to SSH call only when puchbackup runs in background.
Also fixed dummyssh in skipping options before hostname, added unittest.

Reviewed By: quark-zju

Differential Revision: D7119123

fbshipit-source-id: 2c8e66fee44cca5b23389cba8e21e3a0b237268e
2018-04-13 21:51:21 -07:00
Jun Wu
406b752720 tests: use an environment variable for getdb.sh location
Summary:
Make `library.sh` read `$HGTEST_GETDB_PATH` for `getdb.sh` location. Unify
`getdb.sh` used by infinitepush and hgsql into one.

Reviewed By: ryanmce

Differential Revision: D6974635

fbshipit-source-id: 55bcebfbdaca7f43fb0cfca0d3e089e76cf9f24e
2018-04-13 21:51:11 -07:00
Liubov Dmitrieva
9d7e085b49 Implement support for short hashes
Summary:
[infinitepush] Implement support for short hashes

Also, fix test that was broken and lint errors

Reviewed By: StanislavGlebik

Differential Revision: D6814967

fbshipit-source-id: fef1ae79ef85ebf84aa88cd99367946256049192
2018-04-13 21:50:59 -07:00
Jordi Llull Chavarria
e731a435e4 Add missing column to infinitepush test table
Summary: The time column was missing in the bookmark test table

Reviewed By: StanislavGlebik

Differential Revision: D6819122

fbshipit-source-id: c0b4ede651ba5c598f0384580942cfb727b5fe61
2018-04-13 21:50:59 -07:00
Saurabh Singh
551e557862 infinitepush: move library-infinitepush.sh to infinitepush/library.sh
Summary: Makes more sense to have this structure after D6691821.

Test Plan: Ran all the tests.

Reviewers: quark, #mercurial, #sourcecontrol

Reviewed By: quark

Differential Revision: https://phabricator.intern.facebook.com/D6694171

Signature: 6694171:1515609818:1142419346e3458db7674b1b69036d88e82a1903
2018-01-10 10:44:15 -08:00
Saurabh Singh
80ce1d8bce infinitepush: move sql related infinitepush tests from fb-hgext/tests to tests
Summary:
Now that we moved infinitepush to hgext in D6691670, we can also move
the tests. The sql related tests need special attention because of the db
connection and mysql connector.

Test Plan:
Ran all the tests. Removed the mysql connector and checked that the
test is skipped. Also checked that the test is skipped if the db connection
details are not specified.

Reviewers: ikostia, singhsrb, #mercurial, #sourcecontrol

Reviewed By: ikostia

Subscribers: rmcelroy

Differential Revision: https://phabricator.intern.facebook.com/D6691821

Signature: 6691821:1515600428:279dc4796c9be721c5fa81ac2dcd6e065ac30f18
2018-01-10 08:10:27 -08:00