Skip to content

Commit

Permalink
Profile tests (#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Oct 4, 2022
1 parent 101c60b commit 7a9a38f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
/index.redb
/ord.log
/target
/test-times.txt
/tmp
7 changes: 6 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,14 @@ test-deploy:
. root@192.168.56.4:ord
ssh root@192.168.56.4 'cd ord && ./deploy/setup'

report-test-time:
time-tests:
cargo +nightly test -- -Z unstable-options --report-time

profile-tests:
cargo +nightly test -- -Z unstable-options --report-time \
| sed -n 's/^test \(.*\) ... ok <\(.*\)s>/\2 \1/p' | sort -n \
| tee test-times.txt

status:
ssh root@65.108.68.37 systemctl status bitcoind
ssh root@65.108.68.37 systemctl status ord
Expand Down
4 changes: 2 additions & 2 deletions src/subcommand/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1043,12 +1043,12 @@ mod tests {
fn home_block_limit() {
let test_server = TestServer::new();

test_server.bitcoin_rpc_server.mine_blocks(200);
test_server.bitcoin_rpc_server.mine_blocks(101);

test_server.assert_response_regex(
"/",
StatusCode::OK,
".*<ol start=200 reversed class='blocks monospace'>\n( <li><a href=/block/[[:xdigit:]]{64} class=uncommon>[[:xdigit:]]{64}</a></li>\n){100}</ol>.*"
".*<ol start=101 reversed class='blocks monospace'>\n( <li><a href=/block/[[:xdigit:]]{64} class=uncommon>[[:xdigit:]]{64}</a></li>\n){100}</ol>.*"
);
}

Expand Down

0 comments on commit 7a9a38f

Please sign in to comment.