Skip to content

Commit

Permalink
Downgrade image to Python 3.11
Browse files Browse the repository at this point in the history
Also changing `postgres://` to `postgresql://` because support for the
former was dropped in SQLAlchemy 1.4
  • Loading branch information
giovanni-guidini committed Mar 6, 2024
1 parent b13e243 commit 988099d
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 162 deletions.
39 changes: 0 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,42 +82,3 @@ jobs:
with:
push_rolling: true
repo: ${{ vars.CODECOV_IMAGE_V2 || 'codecov/self-hosted-worker' }}

mutation:
name: Run Mutations
needs: [build]
runs-on: ubuntu-latest
env:
AR_REPO: ${{ vars.CODECOV_IMAGE_V2 || 'codecov/self-hosted-worker' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache App
id: cache-app
uses: actions/cache@v3
env:
cache-name: cache-app
with:
path: |
app.tar
key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.run_id }}
- name: Load built image
run: |
docker load --input app.tar
- name: Install docker compose
run: |
sudo curl -SL https://github.com/docker/compose/releases/download/v2.20.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- name: Bring test env up
run: |
make test_env.up
- name: Prepare for tests
run: |
make test_env.prepare
- name: Run mutations
run: |
make test_env.run_mutation
11 changes: 0 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -248,17 +248,6 @@ test_env.container_label_analysis:
test_env.container_ats:
codecovcli -u ${CODECOV_URL} --codecov-yml-path=codecov_cli.yml do-upload --plugin pycoverage --plugin compress-pycoverage --flag onlysomelabels --fail-on-error

test_env.run_mutation:
docker-compose exec worker make test_env.container_mutation

test_env.container_mutation:
apt-get install -y git
git diff origin/main ${full_sha} > data.patch
pip install mutmut[patch]
mutmut run --use-patch-file data.patch || true
mkdir /tmp/artifacts;
mutmut junitxml > /tmp/artifacts/mut.xml

test_env:
make test_env.up
make test_env.prepare
Expand Down
4 changes: 2 additions & 2 deletions database/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ def get_bind(self, mapper=None, clause=None):
database_url=get_config(
"services",
"database_url",
default="postgres://postgres:@postgres:5432/postgres",
default="postgresql://postgres:@postgres:5432/postgres",
),
timeseries_database_url=get_config(
"services",
"timeseries_database_url",
default="postgres://postgres:@timescale:5432/postgres",
default="postgresql://postgres:@timescale:5432/postgres",
),
)

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.requirements
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1.4
ARG PYTHON_IMAGE=python:3.12.2-slim-bookworm
ARG PYTHON_IMAGE=python:3.11-slim-bookworm

# BUILD STAGE
FROM $PYTHON_IMAGE as build
Expand Down
4 changes: 2 additions & 2 deletions docker/test_codecov_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ setup:
encryption_secret: "zp^P9*i8aR3"

services:
database_url: postgres://postgres:password@postgres:5432/postgres
timeseries_database_url: postgres://postgres:password@timescale:5432/postgres
database_url: postgresql://postgres:password@postgres:5432/postgres
timeseries_database_url: postgresql://postgres:password@timescale:5432/postgres
redis_url: redis://redis:6379
minio:
hash_key: testixik8qdauiab1yiffydimvi72ekq # never change this
Expand Down
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
https://github.com/codecov/shared/archive/5c6de0f898bfa32ef64a23b3519e44fa99028845.tar.gz#egg=shared
https://github.com/codecov/shared/archive/51afadfc8cc677f216c44a87d2609c84c564da01.tar.gz#egg=shared
https://github.com/codecov/opentelem-python/archive/refs/tags/v0.0.4a1.tar.gz#egg=codecovopentelem
https://github.com/codecov/test-results-parser/archive/5515e960d5d38881036e9127f86320efca649f13.tar.gz#egg=test-results-parser
boto3
Expand Down
Loading

0 comments on commit 988099d

Please sign in to comment.