Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO NOT REVIEW or MERGE: Consolidated from branch pytest-github-workflow #246

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
d553333
Consolidated from branch pytest-github-workflow
Bill-Kunj Jul 13, 2021
7c1de6c
remove cd
Bill-Kunj Jul 13, 2021
a6f9057
more more
Bill-Kunj Jul 13, 2021
8551465
add pyrchain to second pip
Bill-Kunj Jul 13, 2021
9838672
more more
Bill-Kunj Jul 13, 2021
e0cbe7e
try again
Bill-Kunj Jul 13, 2021
2d71a82
asdf
Bill-Kunj Jul 13, 2021
a7acd09
adf
Bill-Kunj Jul 13, 2021
4e13be9
try sudo
Bill-Kunj Jul 13, 2021
f76a17a
adsfadf
Bill-Kunj Jul 13, 2021
528cfbd
dgnh
Bill-Kunj Jul 13, 2021
9ebdb16
fhjk
Bill-Kunj Jul 13, 2021
4f65d38
ewrty
Bill-Kunj Jul 13, 2021
7fb4044
sfgsghsfgh
Bill-Kunj Jul 13, 2021
61f44f7
take out blocking tail in bootstrap
Bill-Kunj Jul 13, 2021
f0c0e60
Fix error conditions with stty on non-existent terminal during github…
Bill-Kunj Jul 13, 2021
55074fd
fix blocking tail -f
Bill-Kunj Jul 13, 2021
fab0107
adf
Bill-Kunj Jul 13, 2021
cb8d2e2
add rgov to pythonpath
Bill-Kunj Jul 13, 2021
92b02a8
blah
Bill-Kunj Jul 13, 2021
b786726
adf
Bill-Kunj Jul 13, 2021
86d5a8e
asdfasdf
Bill-Kunj Jul 13, 2021
80b69dc
adfadsf
Bill-Kunj Jul 13, 2021
53e28d6
;klasdjhf
Bill-Kunj Jul 13, 2021
4a6f262
tgfhj
Bill-Kunj Jul 13, 2021
26c4fc7
adsf
Bill-Kunj Jul 13, 2021
5f0c323
asdf
Bill-Kunj Jul 13, 2021
3e99596
adsf
Bill-Kunj Jul 13, 2021
525c148
adf
Bill-Kunj Jul 13, 2021
711d153
eliminate MasterURI.localhost.json from git status
Bill-Kunj Jul 21, 2021
18ab31d
Merge branch 'pytest-action-2' of github.com:rchain-community/rgov in…
Bill-Kunj Jul 21, 2021
d0fa1fa
adsf
Bill-Kunj Jul 21, 2021
94747f3
force commit/push for testing
Bill-Kunj Jul 21, 2021
21f06d5
Update pytest.yml
Bill-Kunj Jul 21, 2021
0e4fa2a
structure yaml file better
Bill-Kunj Jul 21, 2021
c46e49c
Merge branch 'pytest-action-2' of github.com:rchain-community/rgov in…
Bill-Kunj Jul 21, 2021
2ff7bf9
Update pytest.yml
Bill-Kunj Jul 21, 2021
38f5edc
adsf
Bill-Kunj Jul 21, 2021
74fc580
Merge branch 'pytest-action-2' of github.com:rchain-community/rgov in…
Bill-Kunj Jul 21, 2021
4bf28e1
add more structure and reduce dependencies
Bill-Kunj Jul 21, 2021
197403c
ad
Bill-Kunj Jul 21, 2021
6456576
adf
Bill-Kunj Jul 21, 2021
f68c644
adf
Bill-Kunj Jul 21, 2021
85b6201
Update pytest.yml
Bill-Kunj Jul 21, 2021
a828fa8
adf
Bill-Kunj Jul 21, 2021
c4ebe4c
Merge branch 'pytest-action-2' of github.com:rchain-community/rgov in…
Bill-Kunj Jul 21, 2021
5c6a0e1
Update pytest.yml
Bill-Kunj Jul 21, 2021
ee293e3
asdf
Bill-Kunj Jul 21, 2021
a778f4d
a
Bill-Kunj Jul 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Run the python tests for rholang actions

on: [ push, pull_request ]

jobs:
checkout:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6.13]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: install-grpcio
run: |
pip3 install -U grpcio-tools
- name: Install PyRchain
run: |
git clone https://github.com/rchain/pyrchain.git
cd pyrchain
pip3 install -e .[dev]
- name: update protobufs and generated files
run: |
cd pyrchain
./update-protobufs
./update-generated || exit 0
env:
PYTHONPATH: $GITHUB_WORKSPACE
- name: Install openjdk11
run: |
sudo apt install openjdk-11-jre-headless
- name: Get rnode
run: |
wget https://github.com/rchain/rchain/releases/download/v0.10.2/rnode_0.10.2_all.deb
- name: install rnode
run: |
sudo dpkg -i rnode_0.10.2_all.deb
- name: genesis
run: |
bootstrap/bootstrap
- name: rgov deployment
run: |
bootstrap/deploy-all
- name: Run RGOV rnode
run: |
bootstrap/run-rnode
- name: Test with pytest
run: |
ls -a .
ls -da *
ls -a *
echo $GITHUB_WORKSPACE
export PYTHONPATH=~
export PYTHONPATH=$PYTHONPATH:$GITHUB_WORKSPACE
export PYTHONPATH=$PYTHONPATH:~/.local/lib/python3.6/site-packages
export PYTHONPATH=$PYTHONPATH:$GITHUB_WORKSPACE/pyrchain
export PYTHONPATH=$PYTHONPATH:/opt/hostedtoolcache/Python/3.6.13/x64/lib/python3.6/site-packages
echo $PYTHONPATH
ls testing
testing/unit_test/test_peekInbox.py
cd testing && pytest
27 changes: 21 additions & 6 deletions bootstrap/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,36 @@ private_key=$(cat PrivateKeys/pk.bootstrap)
mkdir -p ~/.rnode || exit 3
tar cf - genesis|(cd ~/.rnode; tar xvf -) || exit 3

rnode run -s \
rm -f /tmp/bootstrap.fifo
mkfifo /tmp/bootstrap.fifo

stdbuf -oL -eL rnode run -s \
--validator-private-key "$private_key" \
--dev-mode \
-XX:MaxDirectMemorySize=100m -XX:MaxRAMPercentage=25 \
> "$LOGFILE" 2>&1 &
> /tmp/bootstrap.fifo 2>&1 &

PID=$!

# The previous command doesn't produce output -- but this one makes up for that
tail -f "$LOGFILE"|sed -e '/Making a transition to Running state./q'
while true;do
if read -r line < /tmp/bootstrap.fifo;then
if echo "$line"|grep 'Making a transition to Running state.';then
break
fi
echo "$ME: $line"
else
sleep 1
fi
done | tee "$LOGFILE"

rm -f /tmp/bootstrap.fifo

echo "$ME: Stopping $ME rnode process"
sleep 3 && kill $PID && sleep 3
sleep 3 && kill "$PID"

wait "$PID"

echo "$ME: Creating snapshot '$ME'"
./create-snapshot "$ME"

stty echo
stty echo || exit 0
32 changes: 22 additions & 10 deletions bootstrap/deploy-all
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,34 @@ git clone https://github.com/rchain/rchain.git || (cd rchain && git pull)
# Updating our local source should be an option -- look into the wisdom of this
#git pull https://github.com/rchain-community/liquid-democracy.git

rnode run -s \
--validator-private-key "$private_key" \
--dev-mode \
-XX:MaxDirectMemorySize=100m -XX:MaxRAMPercentage=25 \
> "$LOGFILE" 2>&1 &
rm -f /tmp/deploy-all.fifo
mkfifo /tmp/deploy-all.fifo

stdbuf -oL -eL rnode run -s \
--validator-private-key "$private_key" \
--dev-mode \
-XX:MaxDirectMemorySize=100m -XX:MaxRAMPercentage=25 \
> /tmp/deploy-all.fifo 2>&1 &

PID=$!

# The previous command doesn't produce output -- but this makes up for that
tail -F "$LOGFILE"|sed -e '/Making a transition to Running state./q' | sed "s/^/$ME: /"
while true;do
if read -r line < /tmp/deploy-all.fifo;then
if echo "$line"|grep 'Making a transition to Running state.';then
break
fi
echo "$ME: $line"
else
sleep 1
fi
done | tee "$LOGFILE"

cat < /tmp/deploy-all.fifo | tee -a "$LOGFILE" &

deployFiles() {
WAITPID=""
while read -r t;do
$DEPLOY "$t" &
$DEPLOY "$t"
# shellcheck disable=SC2030
WAITPID="$WAITPID $!"
done |tee -a log/deployment.log 2>&1
Expand Down Expand Up @@ -122,6 +134,6 @@ rnode --grpc-port 40402 propose 2>&1 | tee -a log/deployment.log
echo "$ME: Waiting for rnode to finalize (10s)" && sleep 10 && echo "$ME: Stopping deployment rnode"
kill $PID && sleep 2

echo "$ME: Creating rgov snapshot"
wait $PID && echo "$ME: Creating rgov snapshot"
./create-snapshot rgov
stty echo # for some reason, deploy screws up the terminal, so set it right
stty echo || exit 0
11 changes: 9 additions & 2 deletions bootstrap/run-rnode
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ rnode run -s \
-XX:MaxDirectMemorySize=100m -XX:MaxRAMPercentage=25 \
> log/run-rnode.log 2>&1 &

tail -F log/run-rnode.log 2>/dev/null|sed -e '/Making a transition to Running state./q'
while true;do
if grep 'Making a transition to Running state.' log/run-rnode.log;then
break
else
sleep 1
fi
done

stty echo
# exit 0 is required to make this work in github actions
stty echo || exit 0
3 changes: 0 additions & 3 deletions src/MasterURI.localhost.json

This file was deleted.