From 453cd376451f01be94327369a8765e94d18d2481 Mon Sep 17 00:00:00 2001 From: Ondrej Nosek Date: Mar 07 2023 18:11:33 +0000 Subject: Update docker image for Jenkinks tests Regenerate the docker image: Fedora 33 --> Fedora 37. With the newer image, it appeared some files were missing in the MANIFEST.in. Jenkinsfile as a pipeline script is unified with rpkg. JIRA: RHELCMP-11191 Signed-off-by: Ondrej Nosek --- diff --git a/Jenkinsfile b/Jenkinsfile index 326c3c9..9813df6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,7 +23,7 @@ pipeline { } try { echo "Requesting duffy node ..." - def session_str = sh returnStdout: true, script: "set +x; duffy client --url https://duffy.ci.centos.org/api/v1 --auth-name fedora-infra --auth-key $CICO_API_KEY request-session pool=virt-ec2-t2-centos-9s-x86_64,quantity=1" + def session_str = sh returnStdout: true, script: "set +x; duffy client --url https://duffy.ci.centos.org/api/v1 --auth-name fedora-infra --auth-key $CICO_API_KEY request-session pool=virt-ec2-t2-centos-8s-x86_64,quantity=1" def session = readJSON text: session_str DUFFY_SESSION_ID= session.session.id def hostname = session.session.nodes[0].hostname @@ -31,7 +31,7 @@ pipeline { def remote_dir = "/tmp/$JENKINS_AGENT_NAME" echo "remote_dir: $remote_dir" // this makes tests run in parallel if needed: "--parallel=auto --parallel-live" - def TOX_POSARGS = + def TOX_POSARGS = "" writeFile file: 'job.sh', text: """ set -xe dnf install -y git podman @@ -40,7 +40,11 @@ git config --global user.name "jenkins" cd $remote_dir git clone https://pagure.io/fedpkg.git -b master cd fedpkg -git remote rm proposed || true +# remove remote only if exists +remotes=\$(git remote) +if echo "\$remotes" | grep -q "^proposed\$"; then + git remote rm proposed || true +fi git remote add proposed "$params.REPO" git fetch proposed git checkout "origin/$params.BRANCH_TO" @@ -49,9 +53,9 @@ git merge --no-ff "proposed/$params.BRANCH" -m "Merge PR" git clone https://pagure.io/rpkg.git # docker image will contain ENV: PYTHONPATH=./rpkg -podman run --rm -v .:/src:Z quay.io/exd-guild-source-tools/fedpkg-test:f33 tox -e py36,py39,flake8 --workdir /tmp/tox ${TOX_POSARGS} -podman run --rm -v .:/src:Z quay.io/exd-guild-source-tools/fedpkg-test-py2 python2.7 -m pytest test/ -podman run --rm -v .:/src:Z quay.io/exd-guild-source-tools/fedpkg-test-py2 flake8 fedpkg/ test/ +podman run --rm -v .:/src:Z quay.io/exd-guild-source-tools/fedpkg-test:f37 tox -e py36,py39,flake8,bandit --workdir /tmp/tox ${TOX_POSARGS} +podman run --rm -v .:/src:Z quay.io/exd-guild-source-tools/fedpkg-test-py2:latest python2.7 -m pytest test/ +podman run --rm -v .:/src:Z quay.io/exd-guild-source-tools/fedpkg-test-py2:latest flake8 fedpkg/ test/ """ sh "cat job.sh" sh "ssh -o StrictHostKeyChecking=no root@$hostname mkdir $remote_dir" diff --git a/MANIFEST.in b/MANIFEST.in index d68b745..edd6760 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,7 @@ +include requirements.txt +include requirements-py2.txt +include tests-requirements.txt + global-exclude *.pyc global-exclude __pycache__ diff --git a/jenkins_test.dockerfile b/jenkins_test.dockerfile index 629e199..4fd6837 100644 --- a/jenkins_test.dockerfile +++ b/jenkins_test.dockerfile @@ -1,4 +1,4 @@ -FROM fedora:33 +FROM fedora:37 LABEL \ name="fedpkg test" \ description="Run tests using tox with Python 3" \ diff --git a/setup.py b/setup.py index 0c9a1e4..136c30e 100755 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ setup( ('/usr/share/zsh/site-functions', ['conf/zsh-completion/_fedpkg']), ], - setup_requires=['setuptools_scm', 'pytest-runner'], + setup_requires=['pytest-runner'], install_requires=install_requires, tests_require=tests_require,