Menu

[r18]: / regression.py  Maximize  Restore  History

Download this file

34 lines (28 with data), 912 Bytes

 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
import sys,os,subprocess,hashlib,json
def main():
cwd= "/".join(os.path.abspath(__file__).split("\\")[:-1])
regression_dir='%s/regressions'%(cwd)
tests=['test1','test2','test3']
for test in tests:
csv_file="%s/%s.csv"%(regression_dir,test)
excel_file="%s/%s.xlsx"%(regression_dir,test)
config_file="%s/%s.txt"%(regression_dir,test)
ref_file="%s/%s_ref.dbg"%(regression_dir,test)
debug_file="%s/%s.dbg"%(regression_dir,test)
command="report.py -o %s -c %s -dbf %s"%(excel_file,config_file,debug_file)
status=subprocess.call(command,shell=True)
f=open(ref_file,'rb')
ref_hash=hashlib.md5(f.read()).hexdigest()
f.close()
f=open(debug_file,'rb')
new_hash=hashlib.md5(f.read()).hexdigest()
f.close()
if new_hash!=ref_hash:
print "Mismatch"
exit()
else:
print "OK"
os.remove(debug_file)
if __name__=="__main__":
main()
exit(0)
MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.
Try Free →