Commit Graph

15 Commits

Author SHA1 Message Date
Johan Schuijt-Li
5e4a97cecc tests: provision fb identity in to testing certificates
Summary:
In order to do more complete tests around authentication we need to provide
fb identity in to our test certificates.

Reviewed By: StanislavGlebik

Differential Revision: D15046017

fbshipit-source-id: 3f3cd450425944a2970c6f02e7eb92a878076a05
2019-05-21 12:25:19 -07:00
Lukas Piatkowski
9398bf5231 hooks/verify_integrity: pass username and ssh env variables from CoreContext to verify_integrity.py
Summary: In this final diff for verify_integrity the data authorization data is being passed from hgcli (where the ssh connection is established) to Mononoke where it is further passed to verify_integrity script.

Reviewed By: StanislavGlebik

Differential Revision: D14387759

fbshipit-source-id: 2c0f9eef4128f5af0052276a1830ea2f449fb03a
2019-03-11 10:43:50 -07:00
Liubov Dmitrieva
310e8dab3d make test infra files to be symlinks to the mercurial ones.
Summary:
I already made them the same (but copy) in a different diff. As we discussed at
war room, symlinks is a better solution.

Also removed unused import and some functions that were copied from mercurial.
This is no longer needed as we now share tinit.sh with general purpose
functions.

The only mononoke specific file left is dummyssh.py

I think later we could pack them in a separate buck target or something and share in a better way that symlinks but for now it is the easiest solution.

Reviewed By: DurhamG

Differential Revision: D13881960

fbshipit-source-id: 36f425d6f0ddbae2c9d083de35d2779669dc01e7
2019-01-30 11:51:41 -08:00
Liubov Dmitrieva
77cc38f5d9 move to the same hg tests runner that is used by hg
Summary:
This is the first step, I just copied the files from mercurial to mononoke/tests/integration/third_party and made it work.

Further unification is required to reuse the same files.

It renders progress bars and other fancy things and matches our mercurial test framework.

Also it allows to use embedded python code!

Some things are not supported: like aliases, so changes in the tests are required.

Some  tests used urandom and cat in a wrong way, I had to fix it as well.

Reviewed By: lukaspiatkowski

Differential Revision: D13871531

fbshipit-source-id: c723bb18c2233639bb36bc7964e57baddff4c0b9
2019-01-30 07:29:53 -08:00
Jun Wu
7532a39624 codemod: import from the edenscm package
Summary:
D13853115 adds `edenscm/` to `sys.path` and code still uses `import mercurial`.
That has nasty problems if both `import mercurial` and
`import edenscm.mercurial` are used, because Python would think `mercurial.foo`
and `edenscm.mercurial.foo` are different modules so code like
`try: ... except mercurial.error.Foo: ...`, or `isinstance(x, mercurial.foo.Bar)`
would fail to handle the `edenscm.mercurial` version. There are also some
module-level states (ex. `extensions._extensions`) that would cause trouble if
they have multiple versions in a single process.

Change imports to use the `edenscm` so ideally the `mercurial` is no longer
imported at all. Add checks in extensions.py to catch unexpected extensions
importing modules from the old (wrong) locations when running tests.

Reviewed By: phillco

Differential Revision: D13868981

fbshipit-source-id: f4e2513766957fd81d85407994f7521a08e4de48
2019-01-29 17:25:00 -08:00
Johan Schuijt-Li
9961d23e4f Support TLS resumption on mononoke
Summary: .

Reviewed By: StanislavGlebik

Differential Revision: D13564745

fbshipit-source-id: 04c66084984100df1073313a11493d79a839bd18
2019-01-03 08:46:15 -08:00
Mark Thomas
bd0c00d4a5 run-tests: close child stdout after running test
Summary:
Tests don't close the child process stdout.  On newer versions of Python, this
can lead to ResourceWarnings when the test runner thread terminates.

Reviewed By: HarveyHunt

Differential Revision: D13517425

fbshipit-source-id: 6cedf4f39efe1299c41dbde784daf8c159309640
2018-12-19 07:52:48 -08:00
Mark Thomas
83a5782ec2 run-tests: fix escape sequences
Summary:
Some of the escape sequences in run-tests.py are invalid.  These cause
DeprecationWarnings on newer versions of Python.

In both cases, there are `\` characters that need to be escaped as `\\`.

Reviewed By: HarveyHunt

Differential Revision: D13517137

fbshipit-source-id: a899c3c28d55210f5972a515474a2fa69d051671
2018-12-19 07:52:48 -08:00
Stanislau Hlebik
d787921c35 mononoke: tls for hgcli and Mononoke server
Summary:
Use tls for connection between hgcli and Mononoke server always, even for
localhost connections[1]

The setup is similar to tls setup of Eden server.

[1] This is not necessary of course, but adding an option to bypass tls
connection may result in accidental use of it in prod. However if it turns out
to be too unusable, we can add such option in the future

Reviewed By: jsgf

Differential Revision: D8644299

fbshipit-source-id: 0898e30e33b718e13a766763479f3adf9323ffe7
2018-06-29 14:37:44 -07:00
Stanislau Hlebik
7e540c6dbc mononoke: use tcp instead of unix socket for hgcli
Summary: This allows us to put hgcli on the different host

Reviewed By: jsgf

Differential Revision: D7910980

fbshipit-source-id: 45bdd1ee42b54f8f1a425ed6950e785cdf85bfc3
2018-05-10 02:02:40 -07:00
Stanislau Hlebik
a4e7962ffc mononoke: add a separate connection acceptor thread
Summary:
Curently hgcli can connect to Mononoke only if they are on the same host,
because unix domain socket are used. Also Mononoke has to use separate unix
domain socket for different repos.
The goal of this stack of diffs is to remove these limitations:
1 Make it possible to have hgcli and Mononoke server on different hosts
2 Make it possible to use one port/unix domain socket to connect to many repos.

This diff adds a separate thread that parses the Preamble, extracts the
reponame and sends request to a thread responsible for this repo.

Also hgcli now has a new cmd line option that specifies path to connect to.

Reviewed By: jsgf

Differential Revision: D7845156

fbshipit-source-id: a48bcfeec4755b2d5b3dfcf8e0383e6945178018
2018-05-10 02:02:38 -07:00
Stanislau Hlebik
4c717285ca mononoke: improve integration tests infra
Summary:
1) Do not use system hg in tests.
Let's use current version of hg in the tests. It will simplify debugging
because we can now easily tweak both hg client and server. It will also result
in fewer test breakages, because previously our tests were broken when system
hg was updated.

2) Run integration tests in parallel with -j option

Reviewed By: quark-zju

Differential Revision: D6998535

fbshipit-source-id: dac4eb6d33978161ffe42d9d6a5a39a3ddf3a4e3
2018-02-16 03:08:40 -08:00
Stanislau Hlebik
108438646d mononoke: fix --interactive
Summary:
There was an upstream fix 573baab2a797 that fixed run-tests --interactive for
test with many test cases. This diff grafts the change

Reviewed By: lukaspiatkowski

Differential Revision: D5902793

fbshipit-source-id: 0b90a0105d0bf0e2d9f5f788503dc40009441c40
2017-09-29 01:13:20 -07:00
Stanislau Hlebik
17613ba4e7 mononoke: add hghave
Summary:
Mercurial test suite have #testcases features. It allows to use the same test
file for two different tests while tweaking just small parts of it.

I used testcases in test-eden-server.t, but I used it incorrectly - #files test
case wasn't actually used at all. This is because hghave is not present in the
repo.

This diff adds hghave. It's a copy-paste from upstream mercurial

Reviewed By: farnz

Differential Revision: D5901439

fbshipit-source-id: 2131733d8c523b7f7ce9e6a087c77fed6a427e6d
2017-09-26 00:36:55 -07:00
facebook-github-bot
2b6af6b941 Initial commit
fbshipit-source-id: f75baa4ff6aa71973f677b752d7aba582cf4927f
2017-07-27 18:00:19 -07:00