Performance testing ------------------- These tests let to compare h2load collected values for two instances of the PSG server. Here is how to use it: - have two PSG server instances running - run the script as follows: ./psg_perf.py tonka1:2180 tonka1:2181 --runs=50 --throws=5 --delay=1 There will be quite a bit of output. If more test cases need to be added then modify the performance.sh script. Note: h2load must be runnable from the same directory as the script. Unit tests ---------- The tests use the udc framework (see the udc NCBI facility). To run the tests: - make sure it is a Linux host - make sure udc is in PATH (e.g. 'which udc') - change the directory to this one - check the psg.bash source code that it connects to the proper server instance (host:port are hardcoded there) - run ./run_tests.py It was forbidden to save the baseline files as is in SVN however it was allowed to save a tar archive. So the wrapper script basically unpacks the baseline files if needed and runs 'udc'. Note: after changing test cases prepare a new archive with the baseline (someone insisted to have an archive in SVN) tar -czf baseline.tar.gz baseline/ Manual tests for the resolution algorithm ----------------------------------------- 1. Make the csv snapshot of the SI2CSI table, e.g. /panfs/pan1.be-md.ncbi.nlm.nih.gov/id_dumps/id_software/cassandra/test/bin/cqlsh idtest214 9042 cqlsh> COPY idmain.si2csi (sec_seq_id, sec_seq_id_type, accession, seq_id_type, version) TO './si2csi.cass.dump'; 2. Prepare the binary convert_to_fasta from the utils subdirectory 3. Have convert_to_fasta convert_to_fasta.sh si2csi_psg_test.py si2csi.cass.dump in the same directory and then run python3 -u ./si2csi_psg_test.py > output 2>&1 NB: an exclusion file can also be supplied for the python script HUP ~~~ HUP records need a cookie. This is how to send cookie with h2load ./h2load -n 100 "http://tonka1:2180/ID/get?seq_id=gb|MF358689|&seq_id_type=5" -H 'cookie: WebCubbyUser="...;...;...;..."' curl -s --cookie 'WebCubbyUser="...;...;...;..."' "http://psg11:12000/ID/get?seq_id=gb|MF358689|&seq_id_type=5" Using psg_client: export NCBI_PSG_AUTH_TOKEN='"...;...;...;..."' echo '{ "jsonrpc": "2.0", "method": "biodata", "params": { "bio_id": [ "gb|WMV97217|", 5 ], "user_args": "disable_processor=WGS" }, "id": "biodata_1" }' | psg_client interactive -server-mode -data-limit 1KB -preview-size 16 -service psg11:12000 vtune ----- On tonka1 it is located here: /usr/local/intel/2018/vtune_amplifier_2018.3.0.558279/bin64/