sapling/tests/test-sparse-extensions.t
Mateusz Kwapich dd16a02f8e sparse: remove the failed attempt to change watchman config during test
Summary:
I've seen the failures like https://phabricator.intern.facebook.com/P56599278
which were the result of "enforce_root_files" being set in our global watchman
config.

It appears that the global configs are being picked up only on server start.
Killing server during the test won't help because watchman is automagically
restarted in our dev environment.

The way to do it properly is to mimic
https://github.com/facebook/watchman/blob/master/tests/integration/WatchmanInstance.py
until we do that I've just put a .watchmanconfig to fix the test.

Test Plan: tests is passing now

Reviewers: #mercurial, ttung, durham, wez, zamsden

Reviewed By: wez, zamsden

Subscribers: mjpieters

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

Signature: t1:3772968:1472158987:0e08c5e9f862ba3d74d016d051b852512d06e399
2016-08-26 11:59:52 -07:00

57 lines
1.9 KiB
Perl

test sparse interaction with other extensions
$ hg init myrepo
$ cd myrepo
$ cat > .hg/hgrc <<EOF
> [extensions]
> sparse=$TESTDIR/../hgext3rd/sparse.py
> strip=
> [simplecache]
> cachedir=$TESTTMP/hgsimplecache
> EOF
Test integration with simplecache for profile reads
$ $PYTHON -c 'import hgext3rd.simplecache' || exit 80
$ printf "[include]\nfoo\n" > .hgsparse
$ hg add .hgsparse
$ hg commit -qm 'Add profile'
$ hg sparse --enable-profile .hgsparse
$ hg status --debug --config extensions.simplecache=
falling back for value sparseprofile:.hgsparse:52fe6c0958d7d08df53bdf7ee62a261abb7f599e:v1
set value for key sparseprofile:.hgsparse:52fe6c0958d7d08df53bdf7ee62a261abb7f599e:v1 to local
$ hg status --debug --config extensions.simplecache=
got value for key sparseprofile:.hgsparse:52fe6c0958d7d08df53bdf7ee62a261abb7f599e:v1 from local
Test fsmonitor integration (if available)
TODO: make fully isolated integration test a'la https://github.com/facebook/watchman/blob/master/tests/integration/WatchmanInstance.py
(this one is using the systemwide watchman instance)
$ touch .watchmanconfig
$ $PYTHON -c 'import hgext.fsmonitor' || exit 80
$ echo "ignoredir1/" >> .hgignore
$ hg commit -Am ignoredir1
adding .hgignore
$ echo "ignoredir2/" >> .hgignore
$ hg commit -m ignoredir2
$ hg sparse --reset
$ hg sparse -I ignoredir1 -I ignoredir2 -I dir1
$ mkdir ignoredir1 ignoredir2 dir1
$ touch ignoredir1/file ignoredir2/file dir1/file
Run status twice to compensate for a condition in fsmonitor where it will check
ignored files the second time it runs, regardless of previous state (ask @sid0)
$ hg status --config extensions.fsmonitor=
? dir1/file
$ hg status --config extensions.fsmonitor=
? dir1/file
Test that fsmonitor ignore hash check updates when .hgignore changes
$ hg up -q ".^"
$ hg status --config extensions.fsmonitor=
? dir1/file
? ignoredir2/file