sapling/tests/test-hgsql-profiler.t
Thomas Jacob 0e6b93a0e0 Add support for RocksDB
Summary:
- Add support for RocksDB engine (developed as a drop in replacement for innodb) to hgsql to allow new xdb.hgsql.1-10 shards to host hg repos
- Prefer MySQL test DBs in same region
- Run all hgsql unit tests also for RocksDB engine
- Allow for nested ifs to make that possible (downside if you switch off rockdb tests, innodb tests are run twice)

Reviewed By: quark-zju

Differential Revision: D7014064

fbshipit-source-id: 073c36176aa7eaf74252ef33c3f47da594920b28
2018-04-13 21:51:13 -07:00

52 lines
953 B
Raku

#testcases case-innodb case-rocksdb
#if case-rocksdb
$ DBENGINE=rocksdb
#else
$ DBENGINE=innodb
#endif
$ . "$TESTDIR/hgsql/library.sh"
# Populate the db with an initial commit
$ initclient client
$ cd client
$ echo x > x
$ hg commit -qAm x
$ cd ..
$ initserver master masterrepo
# Test with stat profiler
$ cat >> master/.hg/hgrc <<EOF
> [hgsql]
> profiler=stat
> profileoutput=$TESTTMP/
> EOF
$ cd client
$ hg push -q ssh://user@dummy/master
$ cat $TESTTMP/hgsql-profile* | grep "Total Elapsed Time"
Total Elapsed Time: * (glob)
$ rm -f $TESTTMP/hgsql-profile*
$ cd ..
# Test with ls profiler
$ cat >> master/.hg/hgrc <<EOF
> [hgsql]
> profiler=ls
> profileoutput=$TESTTMP/
> EOF
$ cd client
$ echo x >> x
$ hg commit -qAm x
$ hg push -q ../master
$ cat $TESTTMP/hgsql-profile* | grep "Total Elapsed Time"
Total Elapsed Time: * (glob)
$ rm -f $TESTTMP/hgsql-profile*
$ cd ..