@@ -34,7 +34,7 @@ slack = new Slack()
3434DEFAULT_CASSANDRA = [' 3.11' , ' 4.0' , ' 4.1' , ' 5.0' ]
3535DEFAULT_DSE = [' dse-5.1.35' , ' dse-6.8.30' , ' dse-6.9.0' ]
3636DEFAULT_HCD = [' hcd-1.0.0' ]
37- DEFAULT_RUNTIME = [' 3.9.23 ' , ' 3. 10.18' , ' 3.11.13' , ' 3.12.11' , ' 3.13.5' ]
37+ DEFAULT_RUNTIME = [' 3.10.18' , ' 3.11.13' , ' 3.12.11' , ' 3.13.5' ]
3838DEFAULT_CYTHON = [" True" , " False" ]
3939matrices = [
4040 " FULL" : [
@@ -119,7 +119,7 @@ def getBuildContext() {
119119
120120def buildAndTest (context ) {
121121 initializeEnvironment()
122- installDriverAndCompileExtensions ()
122+ installDriver ()
123123
124124 try {
125125 executeTests()
@@ -165,15 +165,18 @@ def getMatrixBuilds(buildContext) {
165165
166166def initializeEnvironment () {
167167 sh label : ' Initialize the environment' , script : ''' #!/bin/bash -lex
168- pyenv global ${PYTHON_VERSION}
169- sudo apt-get install socat
170- pip install --upgrade pip
171- pip install -U setuptools
172168
173- # install a version of pyyaml<6.0 compatible with ccm-3.1.5 as of Aug 2023
169+ # One of the integration tests relies on socat so let's install that here
170+ sudo apt-get install -y socat moreutils
171+
172+ pyenv shell ${PYTHON_VERSION}
173+ python -m venv jenkins-venv
174+ . ./jenkins-venv/bin/activate
175+ pip install --upgrade pip setuptools wheel
176+
177+ # Install a version of pyyaml<6.0 compatible with ccm-3.1.5 as of Aug 2023
174178 # this works around the python-3.10+ compatibility problem as described in DSP-23524
175- pip install wheel
176- pip install "Cython<3.0" "pyyaml<6.0" --no-build-isolation
179+ pip install "pyyaml<6.0" --no-build-isolation
177180 pip install ${HOME}/ccm
178181 '''
179182
@@ -182,35 +185,28 @@ def initializeEnvironment() {
182185 if (env. PYTHON_VERSION =~ / 3\. 12\.\d +/ ) {
183186 echo " Cannot install DSE dependencies for Python 3.12.x; installing Apache CassandraⓇ requirements only. See PYTHON-1368 for more detail."
184187 sh label : ' Install Apache CassandraⓇ requirements' , script : ''' #!/bin/bash -lex
188+ . ./jenkins-venv/bin/activate
185189 pip install -r test-requirements.txt
186190 '''
187191 }
188192 else {
189193 sh label : ' Install DataStax Enterprise requirements' , script : ''' #!/bin/bash -lex
194+ . ./jenkins-venv/bin/activate
190195 pip install -r test-datastax-requirements.txt
191196 '''
192197 }
193198 } else {
194199 sh label : ' Install Apache CassandraⓇ requirements' , script : ''' #!/bin/bash -lex
200+ . ./jenkins-venv/bin/activate
195201 pip install -r test-requirements.txt
196202 '''
197203
198204 sh label : ' Uninstall the geomet dependency since it is not required for Cassandra' , script : ''' #!/bin/bash -lex
205+ . ./jenkins-venv/bin/activate
199206 pip uninstall -y geomet
200207 '''
201208 }
202209
203- sh label : ' Install unit test modules' , script : ''' #!/bin/bash -lex
204- pip install --no-deps nose-ignore-docstring nose-exclude
205- pip install service_identity
206- '''
207-
208- if (env. CYTHON_ENABLED == ' True' ) {
209- sh label : ' Install cython modules' , script : ''' #!/bin/bash -lex
210- pip install cython numpy
211- '''
212- }
213-
214210 sh label : ' Download Apache CassandraⓇ or DataStax Enterprise' , script : ''' #!/bin/bash -lex
215211 . ${CCM_ENVIRONMENT_SHELL} ${CASSANDRA_VERSION}
216212 '''
@@ -244,34 +240,55 @@ ENVIRONMENT_EOF
244240 }
245241
246242 sh label : ' Display Python and environment information' , script : ''' #!/bin/bash -le
243+ . ./jenkins-venv/bin/activate
244+
247245 # Load CCM environment variables
248246 set -o allexport
249247 . ${HOME}/environment.txt
250248 set +o allexport
251249
252250 python --version
253251 pip --version
254- pip freeze
255252 printenv | sort
256253 '''
257254}
258255
259- def installDriverAndCompileExtensions () {
260- if (env. CYTHON_ENABLED == ' True' ) {
261- sh label : ' Install the driver and compile with C extensions with Cython' , script : ''' #!/bin/bash -lex
262- python setup.py build_ext --inplace
263- '''
264- } else {
265- sh label : ' Install the driver and compile with C extensions without Cython' , script : ''' #!/bin/bash -lex
266- python setup.py build_ext --inplace --no-cython
267- '''
268- }
256+ def installDriver () {
257+ sh label : ' Install the driver and compile with C extensions with Cython' , script : ''' #!/bin/bash -lex
258+ # Update libev includes and libs to point to the right spot for this install
259+ pyenv shell ${PYTHON_VERSION}
260+ python -m venv libev-venv
261+ . ./libev-venv/bin/activate
262+ pip install toml
263+ python fix-jenkinsfile-libev.py ./pyproject.toml "/usr/include" "/usr/lib/x86_64-linux-gnu" | sponge ./pyproject.toml
264+ deactivate
265+
266+ ls /usr/include/ev.h
267+ ls /usr/lib/x86_64-linux-gnu/libev*
268+
269+ # Now that we've made relevant mods to our local pyproject.toml we're ready to build the driver
270+ . ./jenkins-venv/bin/activate
271+
272+ # Load CCM environment variables
273+ set -o allexport
274+ . ${HOME}/environment.txt
275+ set +o allexport
276+
277+ cat ./pyproject.toml
278+ pip install --verbose --editable .
279+
280+ # After install display a list of packages in the venv for auditing
281+ pip list
282+ '''
269283}
270284
285+
271286def executeStandardTests () {
272287
273288 try {
274289 sh label : ' Execute unit tests' , script : ''' #!/bin/bash -lex
290+ . ./jenkins-venv/bin/activate
291+
275292 # Load CCM environment variables
276293 set -o allexport
277294 . ${HOME}/environment.txt
@@ -289,6 +306,8 @@ def executeStandardTests() {
289306
290307 try {
291308 sh label : ' Execute Simulacron integration tests' , script : ''' #!/bin/bash -lex
309+ . ./jenkins-venv/bin/activate
310+
292311 # Load CCM environment variables
293312 set -o allexport
294313 . ${HOME}/environment.txt
@@ -314,6 +333,8 @@ def executeStandardTests() {
314333
315334 try {
316335 sh label : ' Execute CQL engine integration tests' , script : ''' #!/bin/bash -lex
336+ . ./jenkins-venv/bin/activate
337+
317338 # Load CCM environment variables
318339 set -o allexport
319340 . ${HOME}/environment.txt
@@ -330,6 +351,8 @@ def executeStandardTests() {
330351
331352 try {
332353 sh label : ' Execute Apache CassandraⓇ integration tests' , script : ''' #!/bin/bash -lex
354+ . ./jenkins-venv/bin/activate
355+
333356 # Load CCM environment variables
334357 set -o allexport
335358 . ${HOME}/environment.txt
@@ -351,6 +374,8 @@ def executeStandardTests() {
351374 else {
352375 try {
353376 sh label : ' Execute DataStax Enterprise integration tests' , script : ''' #!/bin/bash -lex
377+ . ./jenkins-venv/bin/activate
378+
354379 # Load CCM environment variable
355380 set -o allexport
356381 . ${HOME}/environment.txt
@@ -369,6 +394,8 @@ def executeStandardTests() {
369394
370395 try {
371396 sh label : ' Execute DataStax Astra integration tests' , script : ''' #!/bin/bash -lex
397+ . ./jenkins-venv/bin/activate
398+
372399 # Load CCM environment variable
373400 set -o allexport
374401 . ${HOME}/environment.txt
@@ -386,6 +413,8 @@ def executeStandardTests() {
386413 if (env. PROFILE == ' FULL' ) {
387414 try {
388415 sh label : ' Execute long running integration tests' , script : ''' #!/bin/bash -lex
416+ . ./jenkins-venv/bin/activate
417+
389418 # Load CCM environment variable
390419 set -o allexport
391420 . ${HOME}/environment.txt
@@ -404,6 +433,8 @@ def executeStandardTests() {
404433
405434def executeDseSmokeTests () {
406435 sh label : ' Execute profile DataStax Enterprise smoke test integration tests' , script : ''' #!/bin/bash -lex
436+ . ./jenkins-venv/bin/activate
437+
407438 # Load CCM environment variable
408439 set -o allexport
409440 . ${HOME}/environment.txt
@@ -418,6 +449,8 @@ def executeDseSmokeTests() {
418449
419450def executeEventLoopTests () {
420451 sh label : ' Execute profile event loop manager integration tests' , script : ''' #!/bin/bash -lex
452+ . ./jenkins-venv/bin/activate
453+
421454 # Load CCM environment variable
422455 set -o allexport
423456 . ${HOME}/environment.txt
0 commit comments