Megatest

Check-in [a0a226d3f4]
Login
Overview
Comment:Added /utils/mt-new-to-old.sh and mt-old-to-new.sh for converting megatest.db to/from main.db, 1.db etc
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.70
Files: files | file ages | folders
SHA1: a0a226d3f493c35893d9202a652c6cdc9556b382
User & Date: mmgraham on 2022-06-10 20:05:19
Other Links: branch diff | manifest | tags
Context
2022-06-10
23:36
Changed .db directories to .megatest check-in: be8e6a1b38 user: mmgraham tags: v1.70, v1.7003
20:05
Added /utils/mt-new-to-old.sh and mt-old-to-new.sh for converting megatest.db to/from main.db, 1.db etc check-in: a0a226d3f4 user: mmgraham tags: v1.70
10:49
Fixed db:multi-db-sync when /tmp dbs do not exist check-in: 6ddbf1276a user: mmgraham tags: v1.70
Changes

Modified Makefile from [8882cd4b6e] to [9727712751].

298
299
300
301
302
303
304









305
306
307
308
309
310
311
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320







+
+
+
+
+
+
+
+
+







$(PREFIX)/bin/nbfind : utils/nbfind
	$(INSTALL) $< $@
	chmod a+x $@

$(PREFIX)/bin/mtrunner : utils/mtrunner
	$(INSTALL) $< $@
	chmod a+x $@

$(PREFIX)/bin/mt-old-to-new.sh : utils/mt-old-to-new.sh
	$(INSTALL) $< $@
	chmod a+x $@

$(PREFIX)/bin/mt-new-to-old.sh : utils/mt-new-to-old.sh
	$(INSTALL) $< $@
	chmod a+x $@


deploytarg/nbfake : utils/nbfake
	$(INSTALL) $< $@
	chmod a+x $@

deploytarg/viewscreen : utils/viewscreen
	$(INSTALL) $< $@
344
345
346
347
348
349
350

351
352
353
354
355
356
357
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367







+







	$(INSTALL) lib/libxcb-xlib.so.0 $(PREFIX)/bin/.$(ARCHSTR)/lib/libxcb-xlib.so.0; \
        fi

install : $(PREFIX)/bin/.$(ARCHSTR) $(PREFIX)/bin/.$(ARCHSTR)/mtest $(PREFIX)/bin/megatest \
          $(PREFIX)/bin/.$(ARCHSTR)/dboard $(PREFIX)/bin/dashboard $(HELPERS) $(PREFIX)/bin/nbfake \
          $(PREFIX)/bin/.$(ARCHSTR)/mtexec $(PREFIX)/bin/mtexec $(PREFIX)/bin/serialize-env \
	  $(PREFIX)/bin/nbfind $(PREFIX)/bin/mtrunner $(PREFIX)/bin/viewscreen $(PREFIX)/bin/mt_xterm \
          $(PREFIX)/bin/mt-old-to-new.sh $(PREFIX)/bin/mt-new-to-old.sh \
	  $(PREFIX)/share/docs/megatest_manual.html $(PREFIX)/bin/remrun \
	  $(PREFIX)/share/docs/megatest_manual.html $(PREFIX)/bin/remrun $(PREFIX)/bin/mtutil \
	  $(PREFIX)/bin/tcmt $(PREFIX)/share/db/mt-pg.sql \
          $(PREFIX)/share/js/jquery-3.1.0.slim.min.js \
          $(PREFIX)/bin/.$(ARCHSTR)/lib/libpangox-1.0.so \
          $(PREFIX)/bin/.$(ARCHSTR)/lib/libpangox-1.0.so.0 \
          $(PREFIX)/bin/.$(ARCHSTR)/lib/libxcb-xlib.so.0

Added utils/mt-new-to-old.sh version [ae5555fb0a].









1
2
3
4
5
6
7
8
+
+
+
+
+
+
+
+
#!/bin/bash 

cp .db/main.db megatest.db

for db in $(ls .db/?.db); do
  echo $db
  sqlite3 $db "SELECT * FROM tests" | sqlite3 megatest.db ".import /dev/stdin tests"
done

Added utils/mt-old-to-new.sh version [891011889e].





























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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#!/bin/bash 

mkdir -p .db
cp megatest.db .db/main.db
sqlite3 .db/main.db << END_SQL
delete from tests; 
delete from test_steps;
END_SQL
version_id=$(sqlite3 .db/main.db "select id from metadat where var = 'MEGATEST_VERSION'")
current_version=$(megatest -version)
sqlite3 .db/main.db "replace into metadat (id,var,val) values($version_id,'MEGATEST_VERSION','$current_version')"


sqlite3 megatest.db 'select id from runs' > runs.txt
for run in $(cat runs.txt)
do
   dbnum=$(($run%100))
   cp megatest.db .db/$dbnum.db
   sqlite3 .db/$dbnum.db  << END_SQL
   delete from tests where run_id != $run; 
   delete from test_data; 
   delete from test_meta; 
   delete from test_rundat;
   delete from test_steps where not exists ( select id from tests where tests.id = test_steps.test_id);
   replace into metadat (id,var,val) values($version_id,'MEGATEST_VERSION','$current_version');
END_SQL
done