mirror of
https://github.com/krkn-chaos/krkn.git
synced 2026-02-14 09:59:59 +00:00
adding python3.11 updates (#1012)
Signed-off-by: Paige Patton <prubenda@redhat.com>
This commit is contained in:
5
.github/workflows/tests.yml
vendored
5
.github/workflows/tests.yml
vendored
@@ -32,13 +32,14 @@ jobs:
|
|||||||
- name: Install Python
|
- name: Install Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.9'
|
python-version: '3.11'
|
||||||
architecture: 'x64'
|
architecture: 'x64'
|
||||||
- name: Install environment
|
- name: Install environment
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install build-essential python3-dev
|
sudo apt-get install build-essential python3-dev
|
||||||
pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
|
pip install coverage
|
||||||
|
|
||||||
- name: Deploy test workloads
|
- name: Deploy test workloads
|
||||||
run: |
|
run: |
|
||||||
@@ -181,7 +182,7 @@ jobs:
|
|||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: 3.9
|
python-version: '3.11'
|
||||||
- name: Copy badge on GitHub Page Repo
|
- name: Copy badge on GitHub Page Repo
|
||||||
env:
|
env:
|
||||||
COLOR: yellow
|
COLOR: yellow
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ ENV KUBECONFIG /home/krkn/.kube/config
|
|||||||
|
|
||||||
# This overwrites any existing configuration in /etc/yum.repos.d/kubernetes.repo
|
# This overwrites any existing configuration in /etc/yum.repos.d/kubernetes.repo
|
||||||
RUN dnf update && dnf install -y --setopt=install_weak_deps=False \
|
RUN dnf update && dnf install -y --setopt=install_weak_deps=False \
|
||||||
git python39 jq yq gettext wget which ipmitool openssh-server &&\
|
git python3.11 jq yq gettext wget which ipmitool openssh-server &&\
|
||||||
dnf clean all
|
dnf clean all
|
||||||
|
|
||||||
# copy oc client binary from oc-build image
|
# copy oc client binary from oc-build image
|
||||||
@@ -63,15 +63,15 @@ RUN if [ -n "$PR_NUMBER" ]; then git fetch origin pull/${PR_NUMBER}/head:pr-${PR
|
|||||||
# if it is a TAG trigger checkout the tag
|
# if it is a TAG trigger checkout the tag
|
||||||
RUN if [ -n "$TAG" ]; then git checkout "$TAG";fi
|
RUN if [ -n "$TAG" ]; then git checkout "$TAG";fi
|
||||||
|
|
||||||
RUN python3.9 -m ensurepip --upgrade --default-pip
|
RUN python3.11 -m ensurepip --upgrade --default-pip
|
||||||
RUN python3.9 -m pip install --upgrade pip setuptools==78.1.1
|
RUN python3.11 -m pip install --upgrade pip setuptools==78.1.1
|
||||||
|
|
||||||
# removes the the vulnerable versions of setuptools and pip
|
# removes the the vulnerable versions of setuptools and pip
|
||||||
RUN rm -rf "$(pip cache dir)"
|
RUN rm -rf "$(pip cache dir)"
|
||||||
RUN rm -rf /tmp/*
|
RUN rm -rf /tmp/*
|
||||||
RUN rm -rf /usr/local/lib/python3.9/ensurepip/_bundled
|
RUN rm -rf /usr/local/lib/python3.11/ensurepip/_bundled
|
||||||
RUN pip3.9 install -r requirements.txt
|
RUN pip3.11 install -r requirements.txt
|
||||||
RUN pip3.9 install jsonschema
|
RUN pip3.11 install jsonschema
|
||||||
|
|
||||||
LABEL krknctl.title.global="Krkn Base Image"
|
LABEL krknctl.title.global="Krkn Base Image"
|
||||||
LABEL krknctl.description.global="This is the krkn base image."
|
LABEL krknctl.description.global="This is the krkn base image."
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ google-cloud-compute==1.22.0
|
|||||||
ibm_cloud_sdk_core==3.18.0
|
ibm_cloud_sdk_core==3.18.0
|
||||||
ibm_vpc==0.20.0
|
ibm_vpc==0.20.0
|
||||||
jinja2==3.1.6
|
jinja2==3.1.6
|
||||||
krkn-lib==5.1.13
|
krkn-lib==6.0
|
||||||
lxml==5.1.0
|
lxml==5.1.0
|
||||||
kubernetes==34.1.0
|
kubernetes==34.1.0
|
||||||
numpy==1.26.4
|
numpy==1.26.4
|
||||||
@@ -33,7 +33,7 @@ service_identity==24.1.0
|
|||||||
PyYAML==6.0.1
|
PyYAML==6.0.1
|
||||||
setuptools==78.1.1
|
setuptools==78.1.1
|
||||||
wheel==0.42.0
|
wheel==0.42.0
|
||||||
zope.interface==5.4.0
|
zope.interface==6.1
|
||||||
|
|
||||||
git+https://github.com/vmware/vsphere-automation-sdk-python.git@v8.0.0.0
|
git+https://github.com/vmware/vsphere-automation-sdk-python.git@v8.0.0.0
|
||||||
cryptography>=42.0.4 # not directly required, pinned by Snyk to avoid a vulnerability
|
cryptography>=42.0.4 # not directly required, pinned by Snyk to avoid a vulnerability
|
||||||
|
|||||||
@@ -43,14 +43,15 @@ class TestGCP(unittest.TestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
"""Set up test fixtures"""
|
"""Set up test fixtures"""
|
||||||
# Mock google.auth before creating GCP instance
|
# Mock google.auth before creating GCP instance
|
||||||
self.auth_patcher = patch('google.auth.default')
|
self.auth_patcher = patch('krkn.scenario_plugins.node_actions.gcp_node_scenarios.google.auth.default')
|
||||||
self.compute_patcher = patch('google.cloud.compute_v1.InstancesClient')
|
self.compute_patcher = patch('krkn.scenario_plugins.node_actions.gcp_node_scenarios.compute_v1.InstancesClient')
|
||||||
|
|
||||||
self.mock_auth = self.auth_patcher.start()
|
self.mock_auth = self.auth_patcher.start()
|
||||||
self.mock_compute_client = self.compute_patcher.start()
|
self.mock_compute_client = self.compute_patcher.start()
|
||||||
|
|
||||||
# Configure auth mock to return credentials and project_id
|
# Configure auth mock to return credentials and project_id
|
||||||
self.mock_auth.return_value = (MagicMock(), 'test-project-123')
|
mock_credentials = MagicMock()
|
||||||
|
self.mock_auth.return_value = (mock_credentials, 'test-project-123')
|
||||||
|
|
||||||
# Create GCP instance with mocked dependencies
|
# Create GCP instance with mocked dependencies
|
||||||
self.gcp = GCP()
|
self.gcp = GCP()
|
||||||
@@ -67,7 +68,7 @@ class TestGCP(unittest.TestCase):
|
|||||||
|
|
||||||
def test_gcp_init_failure(self):
|
def test_gcp_init_failure(self):
|
||||||
"""Test GCP class initialization failure"""
|
"""Test GCP class initialization failure"""
|
||||||
with patch('google.auth.default', side_effect=Exception("Auth error")):
|
with patch('krkn.scenario_plugins.node_actions.gcp_node_scenarios.google.auth.default', side_effect=Exception("Auth error")):
|
||||||
with self.assertRaises(Exception):
|
with self.assertRaises(Exception):
|
||||||
GCP()
|
GCP()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user