Skip to content

Commit

Permalink
Mock out tests even better, fix pathing
Browse files Browse the repository at this point in the history
  • Loading branch information
juliannguyen4 committed Dec 1, 2023
1 parent 3ce669d commit 77025d4
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 146 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/dev-to-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ jobs:

- name: Filter artifacts
id: filter-output
run: echo bad_artifacts=$(python3 ./.github/workflows/filter-artifacts.py) >> $GITHUB_OUTPUT
run: echo bad_artifacts=$(python3 filter-artifacts.py) >> $GITHUB_OUTPUT
working-directory: ./.github/workflows/

- name: Remove failed artifacts and matrix outputs
uses: geekyeggo/delete-artifact@v2
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/filter-artifacts.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Must be run in .github/workflows
import os

artifact_tests = {}
artifact_successes = {}

os.chdir("matrix-outputs")
print(os.getcwd())

os.chdir("../../matrix-outputs")
file_names = os.listdir()
for file_name in file_names:
# File name format:
Expand Down
288 changes: 144 additions & 144 deletions .github/workflows/stage-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,46 +61,46 @@ jobs:
]
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
ref: ${{ inputs.commit_sha }}
# - uses: actions/checkout@v2
# with:
# submodules: recursive
# ref: ${{ inputs.commit_sha }}

- uses: ./.github/actions/run-ee-server
with:
use-server-rc: ${{ inputs.use-server-rc }}
server-tag: ${{ inputs.server-tag }}
docker-hub-username: ${{ secrets.DOCKER_HUB_BOT_USERNAME }}
docker-hub-password: ${{ secrets.DOCKER_HUB_BOT_PW }}
# - uses: ./.github/actions/run-ee-server
# with:
# use-server-rc: ${{ inputs.use-server-rc }}
# server-tag: ${{ inputs.server-tag }}
# docker-hub-username: ${{ secrets.DOCKER_HUB_BOT_USERNAME }}
# docker-hub-password: ${{ secrets.DOCKER_HUB_BOT_PW }}

- uses: actions/download-artifact@v3
with:
name: sdist
# - uses: actions/download-artifact@v3
# with:
# name: sdist

- name: Run distro container
run: docker run --name ${{ matrix.distros[1] }} --network host --detach ${{ matrix.distros[0] }} tail -f /dev/null
# - name: Run distro container
# run: docker run --name ${{ matrix.distros[1] }} --network host --detach ${{ matrix.distros[0] }} tail -f /dev/null

- name: Copy repo to container
run: docker cp . ${{ matrix.distros[1] }}:/aerospike-client-python
# - name: Copy repo to container
# run: docker cp . ${{ matrix.distros[1] }}:/aerospike-client-python

- name: Install python 3.11 if applicable
run: docker exec ${{ matrix.distros[1] }} yum install -y python3.11
if: ${{ matrix.python-version == '3.11' }}
# - name: Install python 3.11 if applicable
# run: docker exec ${{ matrix.distros[1] }} yum install -y python3.11
# if: ${{ matrix.python-version == '3.11' }}

- name: Install build dependencies
run: docker exec ${{ matrix.distros[1] }} yum install -y openssl-devel glibc-devel autoconf automake libtool zlib-devel openssl-devel python-devel
# - name: Install build dependencies
# run: docker exec ${{ matrix.distros[1] }} yum install -y openssl-devel glibc-devel autoconf automake libtool zlib-devel openssl-devel python-devel

- name: Make sure pip is installed
run: docker exec ${{ matrix.distros[1] }} python${{ matrix.python-version }} -m ensurepip
# - name: Make sure pip is installed
# run: docker exec ${{ matrix.distros[1] }} python${{ matrix.python-version }} -m ensurepip

- name: Install more build dependencies using pip
run: docker exec --workdir /aerospike-client-python/ ${{ matrix.distros[1] }} python${{ matrix.python-version }} -m pip install -r requirements.txt
# - name: Install more build dependencies using pip
# run: docker exec --workdir /aerospike-client-python/ ${{ matrix.distros[1] }} python${{ matrix.python-version }} -m pip install -r requirements.txt

- name: Install source distribution
run: docker exec --workdir /aerospike-client-python/ ${{ matrix.distros[1] }} python${{ matrix.python-version }} -m pip install *.tar.gz
# - name: Install source distribution
# run: docker exec --workdir /aerospike-client-python/ ${{ matrix.distros[1] }} python${{ matrix.python-version }} -m pip install *.tar.gz

- name: Install test dependencies
run: docker exec --workdir /aerospike-client-python/test ${{ matrix.distros[1] }} python${{ matrix.python-version }} -m pip install pytest -c requirements.txt
# - name: Install test dependencies
# run: docker exec --workdir /aerospike-client-python/test ${{ matrix.distros[1] }} python${{ matrix.python-version }} -m pip install pytest -c requirements.txt

- name: Run tests
id: test
Expand Down Expand Up @@ -140,45 +140,45 @@ jobs:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.commit_sha }}
# - uses: actions/checkout@v3
# with:
# ref: ${{ inputs.commit_sha }}

- uses: ./.github/actions/run-ee-server
with:
use-server-rc: ${{ inputs.use-server-rc }}
server-tag: ${{ inputs.server-tag }}
docker-hub-username: ${{ secrets.DOCKER_HUB_BOT_USERNAME }}
docker-hub-password: ${{ secrets.DOCKER_HUB_BOT_PW }}
# - uses: ./.github/actions/run-ee-server
# with:
# use-server-rc: ${{ inputs.use-server-rc }}
# server-tag: ${{ inputs.server-tag }}
# docker-hub-username: ${{ secrets.DOCKER_HUB_BOT_USERNAME }}
# docker-hub-password: ${{ secrets.DOCKER_HUB_BOT_PW }}

- uses: actions/download-artifact@v3
with:
name: ${{ matrix.python-version[1] }}-manylinux_${{ matrix.platform[0] }}
# - uses: actions/download-artifact@v3
# with:
# name: ${{ matrix.python-version[1] }}-manylinux_${{ matrix.platform[0] }}

- name: Set up QEMU for cross compiling arm64
if: ${{ matrix.platform[0] == 'aarch64' }}
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
# - name: Set up QEMU for cross compiling arm64
# if: ${{ matrix.platform[0] == 'aarch64' }}
# uses: docker/setup-qemu-action@v2
# with:
# platforms: arm64

- name: Run distro container
run: docker run --name ${{ matrix.distros[1] }} --platform ${{ matrix.platform[1] }} --network host --detach ${{ matrix.distros[0] }} tail -f /dev/null
# - name: Run distro container
# run: docker run --name ${{ matrix.distros[1] }} --platform ${{ matrix.platform[1] }} --network host --detach ${{ matrix.distros[0] }} tail -f /dev/null

- name: Copy repo to container
run: docker cp . ${{ matrix.distros[1] }}:/aerospike-client-python
# - name: Copy repo to container
# run: docker cp . ${{ matrix.distros[1] }}:/aerospike-client-python

- name: Install python 3.11 if applicable
run: docker exec ${{ matrix.distros[1] }} yum install -y python3.11
if: ${{ matrix.python-version[0] == '3.11' }}
# - name: Install python 3.11 if applicable
# run: docker exec ${{ matrix.distros[1] }} yum install -y python3.11
# if: ${{ matrix.python-version[0] == '3.11' }}

- name: Make sure pip is installed
run: docker exec ${{ matrix.distros[1] }} python${{ matrix.python-version[0] }} -m ensurepip
# - name: Make sure pip is installed
# run: docker exec ${{ matrix.distros[1] }} python${{ matrix.python-version[0] }} -m ensurepip

- name: Install wheel
run: docker exec --workdir /aerospike-client-python/ ${{ matrix.distros[1] }} python${{ matrix.python-version[0] }} -m pip install *.whl
# - name: Install wheel
# run: docker exec --workdir /aerospike-client-python/ ${{ matrix.distros[1] }} python${{ matrix.python-version[0] }} -m pip install *.whl

- name: Install test dependencies
run: docker exec --workdir /aerospike-client-python/test ${{ matrix.distros[1] }} python${{ matrix.python-version[0] }} -m pip install pytest -c requirements.txt
# - name: Install test dependencies
# run: docker exec --workdir /aerospike-client-python/test ${{ matrix.distros[1] }} python${{ matrix.python-version[0] }} -m pip install pytest -c requirements.txt

- name: Run tests
id: test
Expand Down Expand Up @@ -213,41 +213,41 @@ jobs:
]
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
ref: ${{ inputs.commit_sha }}
# - uses: actions/checkout@v2
# with:
# ref: ${{ inputs.commit_sha }}

- uses: actions/download-artifact@v3
with:
name: ${{ matrix.python-version[1] }}-manylinux_${{ matrix.platform[0] }}
# - uses: actions/download-artifact@v3
# with:
# name: ${{ matrix.python-version[1] }}-manylinux_${{ matrix.platform[0] }}

- uses: ./.github/actions/run-ee-server
with:
use-server-rc: ${{ inputs.use-server-rc }}
server-tag: ${{ inputs.server-tag }}
docker-hub-username: ${{ secrets.DOCKER_HUB_BOT_USERNAME }}
docker-hub-password: ${{ secrets.DOCKER_HUB_BOT_PW }}

- name: Set up QEMU for cross compiling arm64
if: ${{ matrix.platform[0] == 'aarch64' }}
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
# - uses: ./.github/actions/run-ee-server
# with:
# use-server-rc: ${{ inputs.use-server-rc }}
# server-tag: ${{ inputs.server-tag }}
# docker-hub-username: ${{ secrets.DOCKER_HUB_BOT_USERNAME }}
# docker-hub-password: ${{ secrets.DOCKER_HUB_BOT_PW }}

- name: Run distro container
run: docker run --name ${{ matrix.debian-name }} --platform ${{ matrix.platform[1] }} --network host --detach python:${{ matrix.python-version[0] }}-${{ matrix.debian-name }} tail -f /dev/null
# - name: Set up QEMU for cross compiling arm64
# if: ${{ matrix.platform[0] == 'aarch64' }}
# uses: docker/setup-qemu-action@v2
# with:
# platforms: arm64

- name: Copy repo to container
run: docker cp . ${{ matrix.debian-name }}:/aerospike-client-python
# - name: Run distro container
# run: docker run --name ${{ matrix.debian-name }} --platform ${{ matrix.platform[1] }} --network host --detach python:${{ matrix.python-version[0] }}-${{ matrix.debian-name }} tail -f /dev/null

- name: Make sure pip is installed
run: docker exec ${{ matrix.debian-name }} python${{ matrix.python-version[0] }} -m ensurepip
# - name: Copy repo to container
# run: docker cp . ${{ matrix.debian-name }}:/aerospike-client-python

- name: Install wheel
run: docker exec --workdir /aerospike-client-python/ ${{ matrix.debian-name }} python${{ matrix.python-version[0] }} -m pip install *.whl
# - name: Make sure pip is installed
# run: docker exec ${{ matrix.debian-name }} python${{ matrix.python-version[0] }} -m ensurepip

- name: Install test dependencies
run: docker exec --workdir /aerospike-client-python/test ${{ matrix.debian-name }} python${{ matrix.python-version[0] }} -m pip install pytest -c requirements.txt
# - name: Install wheel
# run: docker exec --workdir /aerospike-client-python/ ${{ matrix.debian-name }} python${{ matrix.python-version[0] }} -m pip install *.whl

# - name: Install test dependencies
# run: docker exec --workdir /aerospike-client-python/test ${{ matrix.debian-name }} python${{ matrix.python-version[0] }} -m pip install pytest -c requirements.txt

- name: Run tests
id: test
Expand All @@ -273,45 +273,45 @@ jobs:
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ inputs.commit_sha }}
# - uses: actions/checkout@v2
# with:
# ref: ${{ inputs.commit_sha }}

# Ubuntu 22.04 uses Python 3.10 by default
- uses: actions/download-artifact@v3
with:
name: cp310-manylinux_${{ matrix.platform[0] }}
# # Ubuntu 22.04 uses Python 3.10 by default
# - uses: actions/download-artifact@v3
# with:
# name: cp310-manylinux_${{ matrix.platform[0] }}

- name: Set up QEMU for cross compiling arm64
if: ${{ matrix.platform[0] == 'aarch64' }}
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
# - name: Set up QEMU for cross compiling arm64
# if: ${{ matrix.platform[0] == 'aarch64' }}
# uses: docker/setup-qemu-action@v2
# with:
# platforms: arm64

- name: Run distro container
run: docker run --name Ubuntu --platform ${{ matrix.platform[1] }} --network host --detach ubuntu:22.04 tail -f /dev/null
# - name: Run distro container
# run: docker run --name Ubuntu --platform ${{ matrix.platform[1] }} --network host --detach ubuntu:22.04 tail -f /dev/null

- uses: ./.github/actions/run-ee-server
with:
use-server-rc: ${{ inputs.use-server-rc }}
server-tag: ${{ inputs.server-tag }}
docker-hub-username: ${{ secrets.DOCKER_HUB_BOT_USERNAME }}
docker-hub-password: ${{ secrets.DOCKER_HUB_BOT_PW }}
# - uses: ./.github/actions/run-ee-server
# with:
# use-server-rc: ${{ inputs.use-server-rc }}
# server-tag: ${{ inputs.server-tag }}
# docker-hub-username: ${{ secrets.DOCKER_HUB_BOT_USERNAME }}
# docker-hub-password: ${{ secrets.DOCKER_HUB_BOT_PW }}

- name: Copy repo to container
run: docker cp . Ubuntu:/aerospike-client-python
# - name: Copy repo to container
# run: docker cp . Ubuntu:/aerospike-client-python

- name: Install python 3.10 that comes by default (step 1)
run: docker exec Ubuntu apt update
# - name: Install python 3.10 that comes by default (step 1)
# run: docker exec Ubuntu apt update

- name: Install python 3.10 that comes by default (step 2)
run: docker exec Ubuntu apt install python3 python3-pip -y
# - name: Install python 3.10 that comes by default (step 2)
# run: docker exec Ubuntu apt install python3 python3-pip -y

- name: Install wheel
run: docker exec --workdir /aerospike-client-python/ Ubuntu python3.10 -m pip install *.whl
# - name: Install wheel
# run: docker exec --workdir /aerospike-client-python/ Ubuntu python3.10 -m pip install *.whl

- name: Install test dependencies
run: docker exec --workdir /aerospike-client-python/test Ubuntu python3.10 -m pip install pytest -c requirements.txt
# - name: Install test dependencies
# run: docker exec --workdir /aerospike-client-python/test Ubuntu python3.10 -m pip install pytest -c requirements.txt

- name: Run tests
id: test
Expand Down Expand Up @@ -342,40 +342,40 @@ jobs:
fail-fast: false
runs-on: ${{ matrix.macos-version }}
steps:
- uses: actions/checkout@v2
with:
ref: ${{ inputs.commit_sha }}
# - uses: actions/checkout@v2
# with:
# ref: ${{ inputs.commit_sha }}

- uses: actions/download-artifact@v3
with:
name: ${{ matrix.python-version[1] }}-macosx_x86_64
# - uses: actions/download-artifact@v3
# with:
# name: ${{ matrix.python-version[1] }}-macosx_x86_64

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version[0] }}
# - uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version[0] }}

- name: Install Docker Engine
run: brew install colima
# - name: Install Docker Engine
# run: brew install colima

- name: Install Docker client
run: brew install docker
# - name: Install Docker client
# run: brew install docker

- name: Start Docker Engine
run: colima start
# - name: Start Docker Engine
# run: colima start

- uses: ./.github/actions/run-ee-server
with:
use-server-rc: true
server-tag: ${{ inputs.server-tag }}
docker-hub-username: ${{ secrets.DOCKER_HUB_BOT_USERNAME }}
docker-hub-password: ${{ secrets.DOCKER_HUB_BOT_PW }}
# - uses: ./.github/actions/run-ee-server
# with:
# use-server-rc: true
# server-tag: ${{ inputs.server-tag }}
# docker-hub-username: ${{ secrets.DOCKER_HUB_BOT_USERNAME }}
# docker-hub-password: ${{ secrets.DOCKER_HUB_BOT_PW }}

- name: Install wheel
run: python3 -m pip install *.whl
# - name: Install wheel
# run: python3 -m pip install *.whl

- name: Install test dependencies
run: python3 -m pip install pytest -c requirements.txt
working-directory: test
# - name: Install test dependencies
# run: python3 -m pip install pytest -c requirements.txt
# working-directory: test

- name: Run tests
run: true
Expand Down

0 comments on commit 77025d4

Please sign in to comment.