Re: How does 'mtn testresult' work?

Mathias Weidner <[email protected]>
Newsgroups gmane.comp.version-control.monotone.devel
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

wrote Richard Hopkins, am 21.12.2012 20:24:
>> cd ../testbranch2
>> echo testkey2 > _MTN/wanted-testresults
>> mtn update
>> - ----- >8 -----
>>
>> I did expect that the last 'mtn update' would fail, since
>> the first
>> revision (99b505..) now contains a cert with name
>> 'testresult' signed
>> by testkey2 and value '1' while the second revision
>> (a4bd7c..) has the
>> same cert but with value '0'.
>>
> 
> You are correct that the update should have failed as your workspace
> revision "passes" and it's update target "fails". However, it seems
> the default definition of 'accept_testresult_change' needs tweaking.
> 
> It's my understanding that 'wanted_testresults' should contain the key
> hash for each of your test suite keys with 1 per line. The problem
> is that the we pass the binary encoding of the hash instead of the
> hex encoding. This will be resolved by the next release.
> 
> In the meantime you can workaround this issue by using the
> default definition but hex encoding the keys beforehand in your
> '_MTN/monotonerc'.

Thanks, your workaround did work for me.

Just one note, for the records. The key hash has to be in upper case or
HexDumpString() must be changed to return the hex encoding in lower case.

I had to experiment a little bit (litter accep_testresult_change() with
io.write()) to find this out ;-)

At last I did

mtn ls keys testkey2 \
|perl -n -e 's/^([0-9a-z]+)\s+testkey2/\U$1/ && print && exit' \
> _MTN/wanted-testresults

copied your code to _MTN/monotonerc and got

mtn update
mtn: updating along branch 'testbranch'
old result: 3569956429E928CE0344FBB567AE637B7CB89B8B is true
new result: 3569956429E928CE0344FBB567AE637B7CB89B8B is true
this is required: 3569956429E928CE0344FBB567AE637B7CB89B8B
old result: 3569956429E928CE0344FBB567AE637B7CB89B8B is true
new result: 3569956429E928CE0344FBB567AE637B7CB89B8B is false
this is required: 3569956429E928CE0344FBB567AE637B7CB89B8B
mtn: already up to date at 99b505974f54aa4d0344b597362791590fd85028

Many thanks,

Mathias
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEARECAAYFAlDVlaIACgkQIjqrn1X6XoxFJACgncaLCQ9g80yEJninhUkK36su
rrEAoKzXLSstJy9I587ZMbO4vsid+PK+
=K2X/
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.