Megatest

Check-in [237a19178b]
Login
Overview
Comment:EDITOR variable properly respected in editwiki. Added check for diff before committing so no extraneous changes on timeline
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.65-wiki-manual
Files: files | file ages | folders
SHA1: 237a19178bf7b962c419090447ed12b093f98031
User & Date: mrwellan on 2018-01-30 14:01:32
Other Links: branch diff | manifest | tags
Context
2018-01-30
14:49
manual make targets check-in: 0179214de8 user: bjbarcla tags: v1.65-wiki-manual
14:01
EDITOR variable properly respected in editwiki. Added check for diff before committing so no extraneous changes on timeline check-in: 237a19178b user: mrwellan tags: v1.65-wiki-manual
12:13
Added editwiki script to utils check-in: be9acfd8ed user: mrwellan tags: v1.65-wiki-manual
Changes

Modified docs/manual/megatest_manual.html from [cbdcf30fd7] to [caf4cc39fa].

866
867
868
869
870
871
872
873
























































874
































875
876
877
878
879
880
881
</div>
</div>
<div class="sect1">
<h2 id="_road_map">Road Map</h2>
<div class="sectionbody">
<div class="paragraph"><p>Note 1: This road-map is still evolving and subject to change without notice.</p></div>
<div class="sect2">
<h3 id="_rfc">RFC</h3>
























































<div class="paragraph"><p>Requests for comment.</p></div>
































</div>
<div class="sect2">
<h3 id="_architecture_refactor">Architecture Refactor</h3>
<div class="sect3">
<h4 id="_goals">Goals</h4>
<div class="olist arabic"><ol class="arabic">
<li>







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
</div>
</div>
<div class="sect1">
<h2 id="_road_map">Road Map</h2>
<div class="sectionbody">
<div class="paragraph"><p>Note 1: This road-map is still evolving and subject to change without notice.</p></div>
<div class="sect2">
<h3 id="_rfc_move_data_into_completed_runs_db">RFC: Move data into completed-runs.db</h3>
<div class="paragraph"><p><strong>Purpose</strong>: shrink megatest.db data to enable lower load and higher performance.</p></div>
<div class="paragraph"><p><strong>Method</strong>: add a completed-runs.db and automatically move runs data from megatest.db to that db</p></div>
<div class="paragraph"><p><strong>Design</strong>:</p></div>
<div class="olist arabic"><ol class="arabic">
<li>
<p>
completed-runs.db is a full megatest database with complete schema
</p>
</li>
<li>
<p>
the data move would involve these steps
</p>
<div class="olist loweralpha"><ol class="loweralpha">
<li>
<p>
copy the run data to completed-runs.db
</p>
</li>
<li>
<p>
remove the run data, first from /tmp/…/megatest.db and /tmp/…/megatest_ref.db, followed by megatest.db
</p>
</li>
</ol></div>
</li>
<li>
<p>
accessing the data would be unchanged for most operations.
</p>
</li>
<li>
<p>
a mode -full-db will be added which when specified would attach the completed-runs.db to megatest.db before doing the query
</p>
</li>
<li>
<p>
mechanisms for moving runs to/from the megatest.db would be added
</p>
<div class="olist loweralpha"><ol class="loweralpha">
<li>
<p>
-reduce-records &#8658; move runs to completed-runs.db
</p>
</li>
<li>
<p>
-restore-records &#8658; move runs from completed-runs.db to megatest.db
</p>
</li>
</ol></div>
</li>
</ol></div>
<div class="paragraph"><p><strong>Branch</strong>: This work is taking place on branch v1.65-reduce-records</p></div>
</div>
<div class="sect2">
<h3 id="_rfc_automatic_homehost_migrations">RFC: Automatic homehost migrations</h3>
<div class="paragraph"><p><strong>Purpose</strong>: Automatically migrate homehost.</p></div>
<div class="paragraph"><p><strong>Method</strong>: Check that there are no tests running, launched or remotehoststart in past ½ hour then if not on homehost migrate the db to current host</p></div>
<div class="paragraph"><p><strong>Design</strong>:</p></div>
<div class="olist arabic"><ol class="arabic">
<li>
<p>
Check that the system is quiescent, i.e. that there are no runs in flight or recently run
</p>
</li>
<li>
<p>
Create a lock
</p>
</li>
<li>
<p>
Migrate the /tmp cache db to the current host
</p>
</li>
<li>
<p>
Update the .homehost file
</p>
</li>
<li>
<p>
Remove the lock
</p>
</li>
</ol></div>
<div class="paragraph"><p><strong>Branch</strong>: This work not yet started</p></div>
</div>
<div class="sect2">
<h3 id="_architecture_refactor">Architecture Refactor</h3>
<div class="sect3">
<h4 id="_goals">Goals</h4>
<div class="olist arabic"><ol class="arabic">
<li>

Modified utils/editwiki from [c87edf48f4] to [14b0c3cc25].

1
2
3
4
5
6
7
8
9
10
11
12
13


14
15
16
17
18
19
20



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36


37
38
39
40



41
42
43
44

45
#!/bin/bash

wikiname=$1
FOSSILBIN=fossil

if [ x"$wikiname" == "x" ];then
  echo "Usage: viwiki wikipagename"
  exit
fi

$FOSSILBIN sync

wikitmpfile=`mktemp /tmp/${USER}_wikiedit.XXXXXXX`


if ! $FOSSILBIN wiki export "$wikiname" 2> /dev/null  1> $wikitmpfile ;then
    cat /dev/null > $wikitmpfile
    wikipagestate='new'
else
    wikipagestate='existing'
fi




if [ x"$EDITOR" == "x" ];then
	EDITOR="gvim -f"
fi

echo $EDITOR | grep -q -e gvim
isGvim=$?

echo $EDITOR | grep -q -e 'gvim.*-f'
hasF=$?

if [[ $isGvim == 0 && $hasF != 0 ]]; then
	EDITOR="$EDITOR -f"
fi

$EDITOR $wikitmpfile



if [ $wikipagestate == 'new' ];then
  $FOSSILBIN wiki create "$wikiname" $wikitmpfile
else
  $FOSSILBIN wiki commit "$wikiname" $wikitmpfile



fi

$FOSSILBIN sync


rm -f $wikitmpfile












|
>
>







>
>
>
|
|














>
>
|
|
|
|
>
>
>




>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash

wikiname=$1
FOSSILBIN=fossil

if [ x"$wikiname" == "x" ];then
  echo "Usage: viwiki wikipagename"
  exit
fi

$FOSSILBIN sync

# wikitmpfile=`mktemp /tmp/${USER}_wikiedit.XXXXXXX`
wikitmpfile=${wikiname}.in

if ! $FOSSILBIN wiki export "$wikiname" 2> /dev/null  1> $wikitmpfile ;then
    cat /dev/null > $wikitmpfile
    wikipagestate='new'
else
    wikipagestate='existing'
fi

# make a backup copy of the extracted file to diff detect if changed
cp $wikitmpfile ${wikitmpfile}.orig

if [[ x"$EDITOR" == "x" ]];then #  || [[ x"$VISUAL" == "x" ]];then
    EDITOR="gvim -f"
fi

echo $EDITOR | grep -q -e gvim
isGvim=$?

echo $EDITOR | grep -q -e 'gvim.*-f'
hasF=$?

if [[ $isGvim == 0 && $hasF != 0 ]]; then
	EDITOR="$EDITOR -f"
fi

$EDITOR $wikitmpfile

if ! diff -q $wikitmpfile ${wikitmpfile}.orig;then
    echo "Saving changes to $wikitmpfile to wiki"
    if [ $wikipagestate == 'new' ];then
        $FOSSILBIN wiki create "$wikiname" $wikitmpfile
    else
        $FOSSILBIN wiki commit "$wikiname" $wikitmpfile
    fi
else
    echo "Not saving, no changes to $wikitmpfile."
fi

$FOSSILBIN sync

# NOTE// We *keep* the wikitmpfile but remove the orig copy
rm -f ${wikitmpfile}.orig