From 760a99b5bfb0b666e8c3a9bb3532d201d3a9a903 Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Fri, 4 Oct 2024 10:24:32 +0100 Subject: [PATCH] Remove use of view file --- Jenkinsfile | 40 ++++++++++++---------- requirements.txt => tests/requirements.txt | 15 ++++---- 2 files changed, 28 insertions(+), 27 deletions(-) rename requirements.txt => tests/requirements.txt (86%) diff --git a/Jenkinsfile b/Jenkinsfile index afded2f6..b04bc1f2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,13 @@ // This file relates to internal XMOS infrastructure and should be ignored by external users -@Library('xmos_jenkins_shared_library@develop') _ +@Library('xmos_jenkins_shared_library@v0.34.0') _ + +def clone_test_deps() { + dir("${WORKSPACE}") { + sh "git clone git@github.com:xmos/test_support" + sh "git -C test_support checkout c820ebe67bea0596dabcdaf71a590c671385ac35" + } +} getApproval() @@ -10,7 +17,6 @@ pipeline { } environment { REPO = 'lib_xud' - VIEW = getViewName(REPO) } options { buildDiscarder(xmosDiscardBuildSettings()) @@ -26,11 +32,7 @@ pipeline { } stages { - stage('Get view') { - steps { - xcorePrepareSandbox("${VIEW}", "${REPO}") - } - } + stage('Build examples') { steps { println "Stage running on ${env.NODE_NAME}" @@ -49,21 +51,26 @@ pipeline { stage('Library checks') { steps { - runLibraryChecks("${WORKSPACE}/${REPO}") + runLibraryChecks("${WORKSPACE}/${REPO}", "v2.0.1") } } stage('Tests') { steps { - dir("${REPO}/tests"){ - viewEnv(){ - withVenv{ + + // Note, moves to WORKSPACE + clone_test_deps() + + withTools(params.TOOLS_VERSION) { + dir("${REPO}/tests") { + createVenv(reqFile: "requirements.txt") + withVenv{ runPytest('--numprocesses=8 --smoke --enabletracing') - } - } - } - } + } + } // dir + } // withTools + } // steps post { failure @@ -74,9 +81,6 @@ pipeline { } } post { - success { - updateViewfiles() - } cleanup { xcoreCleanSandbox() } diff --git a/requirements.txt b/tests/requirements.txt similarity index 86% rename from requirements.txt rename to tests/requirements.txt index b5a19a02..3654c0ad 100644 --- a/requirements.txt +++ b/tests/requirements.txt @@ -1,4 +1,5 @@ -# python_version 3.7.6 +# python_version 3.12.1 +# pip_version 24.2 # # The parse_version_from_requirements() function in the installPipfile.groovy # file of the Jenkins Shared Library uses the python_version comment to set @@ -17,12 +18,9 @@ # pip-install this one as editable using this repository's setup.py file. The # same modules should appear in the setup.py list as given below. -black==21.5b1 -filelock==3.0.12 -# Pin importlib-metadata to <5 due to https://github.com/python/importlib_metadata/issues/409. -importlib-metadata==4.13.0 -pytest==6.2.4 -pytest-xdist==2.3.0 +flake8==7.1.1 +pytest==8.3.2 +pytest-xdist==3.6.1 filelock==3.0.12 # Development dependencies @@ -37,5 +35,4 @@ filelock==3.0.12 # If this repository uses the setup functionality (e.g., script entry points) # of its own setup.py file, then this list must include an entry for that # setup.py file, e.g., '-e .' or '-e ./python' (without the quotes). --e ./python --e ./../test_support +-e ./../../test_support