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