sapling/tests
Jun Wu 89744897fb hgsql: make it test-friendly for external users
Summary:
Previously, when running with an external MySQL setup, it's easy to get the
following "mysterious" error when trying to create the "revisions" table:

  ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes

This is a cleanup of many minor areas to make it easier for external users
to run the test.

  * Move database schema to `schema.sql`, which could be used as `mysql`
    input directly. Remove schema in other places so `schema.sql` is the
    single source of truth.
  * Change `repo`, `namespace` fields to `varchar` to save space.
  * Explicitly set `latin1(_bin)` in schema to avoid potential encoding
    issues. Also specify `InnoDB` to avoid issues of other engines.
  * Source `getdb.sh` instead of parsing its output. Simplifies `getdb.sh`.
  * Provide an example of `getdb.sh` as `getdb.sh.example`.
  * Add `DROP DATABASE` cleanup. External setup probably don't have `testdb`
    dropped automatically.
  * Change `README.md` with the latest instruction about database and test.
  * Bundle `hg-ssh` so `test-pushpull.t` won't fail if it's missing.

Test Plan: `run-tests.py` and it mostly works on a local, non-prod Linux system.

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: stash, rmcelroy, tja, durham, andrasbelo

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

Signature: t1:4313981:1490381520:7c0c9af72ac3446c5ee31f8c9b4376c4198a6dc8
2017-03-23 19:14:52 -07:00
..
dummyssh Add tests 2014-01-28 20:49:56 -08:00
getdb.sh.example hgsql: make it test-friendly for external users 2017-03-23 19:14:52 -07:00
heredoctest.py Add tests 2014-01-28 20:49:56 -08:00
hg-ssh hgsql: make it test-friendly for external users 2017-03-23 19:14:52 -07:00
killdaemons.py Add tests 2014-01-28 20:49:56 -08:00
library.sh hgsql: make it test-friendly for external users 2017-03-23 19:14:52 -07:00
run-tests.py hgsql: fix a bunch of test errors 2015-01-30 15:15:19 -08:00
test-bundle2.t Fix corruption when syncing initial data for generaldelta repos 2016-04-18 22:07:07 -07:00
test-bundlerepo.t Add support for running on top of bundle repos 2015-11-17 13:28:56 -08:00
test-corruption.t bypass: add a hgsql.bypass config option for disabling hgsql 2016-05-11 13:54:24 -07:00
test-filenames.t Hide unnecessary sql warning 2014-04-17 11:09:48 -07:00
test-linkrevs.t test change for generaldelta 2015-12-03 12:58:17 -08:00
test-local-commands.t Hide mysql warning when updating a row with multiple unique keys 2014-03-19 13:06:20 -07:00
test-metrics.t lock: log lock time for failures 2016-12-07 15:46:09 -08:00
test-profiler.t profiling: add the ability to profile the sqllock time 2016-04-29 09:53:17 -07:00
test-pushpull.t hgsql: make it test-friendly for external users 2017-03-23 19:14:52 -07:00
test-pushrebase.t Check for proper location of pushrebase extension 2016-09-05 09:09:20 -07:00
test-race-conditions.t locks: add logging for invalid lock order taking 2016-12-06 16:04:20 -08:00
test-requires.t init: add hgsql requirement during repo init and clone 2016-04-29 09:55:23 -07:00
test-strip.t hgsql: update tests to fix upstream compatibility 2016-09-29 19:56:45 -07:00
test-sync.t Fix incremental updating of heads and bookmarks 2016-10-13 09:47:40 -07:00
test-transaction-restrictions.t hgsql: update tests to fix upstream compatibility 2016-09-29 19:56:45 -07:00