1+ name : Run Tests (reusable)
2+
3+ on :
4+ workflow_call :
5+ inputs :
6+ full_ver :
7+ description : ' Version of the build to test (e.g. 7.4.0-3.1.ow)'
8+ required : true
9+ type : string
10+ build_run_id :
11+ description : ' Run ID to download the correctness package from'
12+ required : true
13+ type : string
14+ secrets :
15+ GITHUB_TOKEN :
16+ required : true
17+
18+ jobs :
19+ tests :
20+ runs-on : ubuntu-latest
21+ env :
22+ JOSHUA_DB_VER : " 7.1.57"
23+ N_OF_TESTS : 500 # to fit in 360 minutes job run limit
24+ JOSHUA_AGENT_URL : " docker.io/marksh2010"
25+ JOSHUA_AGENT_TAG : " rockylinux9.6-20260309"
26+ # parameter that controls the maximum lifetime of the Joshua agent (in seconds).
27+ AGENT_TIMEOUT : 18000
28+
29+ steps :
30+ - name : Checkout
31+ uses : actions/checkout@v4
32+ with :
33+ path : ${{github.workspace}}/src
34+
35+ - name : Install dependencies
36+ shell : bash
37+ run : |
38+ sudo apt-get update
39+ sudo apt-get install -y sudo wget crudini git python3 python3-pip
40+ sudo pip3 install wheel setuptools python-dateutil lxml boto3
41+
42+ - name : Install FoundationDb
43+ shell : bash
44+ run : |
45+ mkdir deb
46+ pushd deb
47+ MY_ARCH=`dpkg-architecture -q DEB_BUILD_ARCH`
48+ wget https://github.com/apple/foundationdb/releases/download/${{ env.JOSHUA_DB_VER }}/foundationdb-clients_${{ env.JOSHUA_DB_VER }}-1_${MY_ARCH}.deb https://github.com/apple/foundationdb/releases/download/${{ env.JOSHUA_DB_VER }}/foundationdb-server_${{ env.JOSHUA_DB_VER }}-1_${MY_ARCH}.deb
49+ sudo apt-get install -y ./foundationdb-clients_${{ env.JOSHUA_DB_VER }}-1_${MY_ARCH}.deb ./foundationdb-server_${{ env.JOSHUA_DB_VER }}-1_${MY_ARCH}.deb
50+ popd
51+ sudo systemctl stop foundationdb
52+ MY_IP=`hostname -I | awk '{print $1}'`
53+ sudo sed -i s/127.0.0.1/$MY_IP/ /etc/foundationdb/fdb.cluster
54+ sudo crudini --set /etc/foundationdb/foundationdb.conf fdbserver memory 4GiB
55+ sudo systemctl start foundationdb
56+ pip3 install 'foundationdb==${{ env.JOSHUA_DB_VER }}'
57+
58+ - name : Download the correctness package
59+ uses : actions/download-artifact@v4
60+ id : download_correctness
61+ with :
62+ name : correctness-${{ inputs.full_ver }}.tar.gz
63+ run-id : ${{ inputs.build_run_id }}
64+ github-token : ${{ secrets.GITHUB_TOKEN }}
65+
66+ - name : Echo download path
67+ run : echo ${{steps.download_correctness.outputs.download-path}}
68+
69+ - name : Display structure of downloaded files
70+ run : ls -R
71+ working-directory : ${{github.workspace}}
72+
73+ - name : Download joshua
74+ shell : bash
75+ run : |
76+ git clone https://github.com/FoundationDB/fdb-joshua.git
77+
78+ - name : run joshua-agent
79+ shell : bash
80+ run : |
81+ podman pull ${{ env.JOSHUA_AGENT_URL }}/joshua-agent:${{ env.JOSHUA_AGENT_TAG }}
82+ for i in 1 2 3 4; do
83+ podman run -d \
84+ -v /etc/foundationdb:/etc/foundationdb \
85+ -e AGENT_TIMEOUT=${{ env.AGENT_TIMEOUT }} \
86+ joshua-agent:${{ env.JOSHUA_AGENT_TAG }}
87+ done
88+
89+ - name : run tests
90+ shell : bash
91+ working-directory : ${{github.workspace}}/fdb-joshua
92+ run : |
93+ podman ps
94+ ${{github.workspace}}/src/build-scripts/for-linux/test-joshua.bash ${{github.workspace}}/correctness-${{ inputs.full_ver }}.tar.gz ${{env.N_OF_TESTS}}
0 commit comments