Commit graph

15 commits

Author SHA1 Message Date
Sitaram Chamarty b22aa284c3 vref: tests 2012-02-26 09:04:30 +05:30
Sitaram Chamarty c59bf16942 (minor) validate all role names, not just the first line!
If you use a role name that was not in GL_WILDREPOS_PERM_CATS, it will
get caught later when someone whom youhave given that role tries to
access the repo (look for another occurrence of the same error message
as this one).

So there's no access violation but it would be nice to be told upfront
that it won't work.
2012-01-26 07:29:03 +05:30
Sitaram Chamarty 2762f7abfd merge-check: test script (first test using 'tsh', yaaay!) 2012-01-16 10:33:04 +05:30
Sitaram Chamarty fdf424ea4f (test suite) dont put adc's in /tmp 2011-10-11 13:53:58 +05:30
Sitaram Chamarty f48a0b9d73 (test suite) changes to test-driver for "all in one user" testing 2011-10-11 13:53:58 +05:30
Sitaram Chamarty f77d0d2cf1 (test suite) t/install also serves as a quick way to "play install" gitolite
(t/install-gitolite has been renamed to t/install)
2011-10-11 13:53:57 +05:30
Sitaram Chamarty 6539009cb5 make REPO_BASE absolute early
$ENV{GL_REPO_BASE_ABS} is meant to point to the same directory as
$REPO_BASE, except it is meant to be passed to hooks, ADCs and other
child programs.  And since you can't be sure where the child program
starts in, this became an absolute path.

Gradually, however, I started using it wherever I needed an absolute
path (mostly in code that jumps around various directories to do stuff).
Which is silly, because there's no reason $REPO_BASE cannot also be made
an absolute, even if the rc file has a relative path.

So that's what I did now: made $REPO_BASE absolute very early on, and
then systematically changed all uses of the longer form to the shorter
form when appropriate.  And so the only thing we now use the longer one
for is to pass to child programs.

(Implementation note: The actual change is not very big, but while I was
about it I decided to make the test suite able to test with an absolute
REPO_BASE also, which is why the commit seems so large.)

----

This all started with a complaint from Damien Regad.  He had an
extremely odd setup where his bashrc changed PWD to something other than
$HOME before anything else ran.  This caused those two variables to
beceom inconsistent, and he had a 1-line fix he wanted me to apply.

I generally don't like making special fixes for for non-standard setups,
and anyway all he had to do was set the full path to REPO_BASE in the rc
file to get around this.  Which is what I told him and he very politely
left it at that.

However, this did get me thinking, and I soon realised I was needlessly
conflating "relative versus absolute" with "able to be passed to child
programs".  Fixing that solved his problem also, as a side-effect.

So I guess this is all thanks to Damien!
2011-03-21 07:51:10 +05:30
Sitaram Chamarty 692552d146 gitolite v2.0rc1 -- please see new developer-notes doc 2011-01-16 07:26:13 +05:30
Sitaram Chamarty 10a30c961d (major change in big-config mode) split the compiled config file
Fedora's config has over 11,000 repositories and the compiled config
file is over 20 MB in size.  Although negligible on a server class
machine, on my laptop just parsing this file takes a good 2.5 seconds.

Even if you use GL_ALL_READ_ALL (see a couple of commits before this
one) to remove the overhead for 'read's, that's still a pretty big
overhead for writes.  And GL_ALL_READ_ALL is not really a solution for
most people anyway.

With this commit, using GL_BIG_CONFIG adds another optimisation; see
doc/big-config.mkd for details (look for the word "split config" to find
the section that talks about it).

----

Implementation notes:

  - the check for GL_NO_CREATE_REPOS has moved *into* the loop (which it
    completely bypassed earlier) so that write_1_compiled_conf can be
    called on each item
2011-01-02 11:30:29 +05:30
Sitaram Chamarty a690058ce6 (test driver) editrc function buglet
Till now I did not have an RC var whose name was a prefix of another
valid RC var, so I never noticed that editrc would set the longer one
also when you set the shorter one.

Fixed
2010-11-06 12:35:46 +05:30
Sitaram Chamarty 74e15d06a0 add "addrc" function to test driver 2010-08-10 12:31:46 +05:30
Sitaram Chamarty fbb9dafbd1 gqt -- gitolite quick (re-)test
sometimes I want to quickly test a few lines of change within the context of
a currently-running/just-ran test, *without* doing the rollback etc.

Here's how you do that now:

  - in your source tree, make the change and then run:
        cp -a src hooks contrib/adc /some/tmp/place
  - go to the tester userid and re-run your tests like so:
        GQT=/some/tmp/place ./test-driver.sh
    it'll rollback as normal then overwrite src and hooks from $GQT

Also, there's now a "dbg" sub that can be used for quick printf-style
debugging.
2010-08-09 23:21:14 +05:30
Sitaram Chamarty 97126608b9 (minor) fixes to test driver 2010-08-09 23:21:14 +05:30
Sitaram Chamarty 3c5bd4a131 test suite: catch internal errors better
...so you don't have to look at all the output for any strangeness

(also make rollback a little quieter)
2010-06-18 22:09:30 +05:30
Sitaram Chamarty 0add3d3de7 finally, open up my secret test scripts...
...after getting rid of most of the hardcoding (though not all!)
2010-06-12 13:24:55 +05:30