comparison pretxncommit.sh @ 4:ddf021c87083

pretxncommit
author drewp@bigasterisk.com
date Sat, 16 Mar 2024 12:02:40 -0700
parents precommit.sh@fa108e01b284
children d885fce5e4e7
comparison
equal deleted inserted replaced
3:b5afa9363c3b 4:ddf021c87083
1 #!/bin/zsh -e
2
3 # e2e test including lib installs and test suite
4
5 HG_NODE=${HG_NODE:-tip}
6
7 echo node = $HG_NODE
8 SRC_DIR=`pwd`
9
10 WORK_DIR=/tmp/rdferry_pretxncommit_$$
11 mkdir $WORK_DIR
12
13 TRAPZERR() {
14 rm -r $WORK_DIR
15 }
16
17
18 # $STAGE_DIR shall have the exact state to be committed.
19
20 STAGE_DIR=$WORK_DIR/stage
21 hg clone -r $HG_NODE $SRC_DIR $STAGE_DIR
22
23
24 # TEST_PROJECT depends on rdferry from STAGE_DIR
25
26 TEST_PROJECT_DIR=$WORK_DIR/test_project
27 mkdir $TEST_PROJECT_DIR
28 cd $TEST_PROJECT_DIR
29 pdm config --local venv.in_project True
30 pdm init --non-interactive
31 pdm add $STAGE_DIR pytest pytest-asyncio aiohttp
32 pdm run python -c 'import rdferry; print(f"using {rdferry}")'
33
34 # pretend the example code is test project's code
35 cp -a ../stage/examples .
36 pdm run pytest examples
37
38 rm -r $WORK_DIR
39 exit 0