Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added integration tests in a lot of different platforms #427

Merged
merged 28 commits into from
May 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a3cc715
Test config.
facundobatista Feb 28, 2024
7abeb4c
Run fades in Arch
facundobatista Feb 28, 2024
38b35a3
Debug
facundobatista Feb 28, 2024
44dcab7
Back to other env var, checkout code
facundobatista Feb 28, 2024
9e65570
Install Python first.
facundobatista Feb 29, 2024
0e9e951
Rename mounted dir so script automatically fixes path.
facundobatista Feb 29, 2024
7b1b52e
Also install setuptools.
facundobatista Feb 29, 2024
34922f9
Fixed purposefully-wrong command.
facundobatista Feb 29, 2024
c9f143f
Added Fedora.
facundobatista Feb 29, 2024
66c5e60
Added native (exploded).
facundobatista Feb 29, 2024
127c806
Install setuptools.
facundobatista Feb 29, 2024
3d17b44
Back to only fedora, incorporate test running other python version.
facundobatista Feb 29, 2024
2cfeb76
Installed virtualenv.
facundobatista Feb 29, 2024
47ccc60
Added the (forgotten) test file.
facundobatista Feb 29, 2024
7aab285
Enabled old arch, improved fedora, and try native.
facundobatista Mar 1, 2024
afee622
Install with sudo.
facundobatista Mar 2, 2024
b6b4a3b
Install Python using an action so it's multiplatform.
facundobatista Mar 2, 2024
99302ae
It's yaml, silly
facundobatista Mar 2, 2024
50f2221
Native we're already in working dir.
facundobatista Mar 2, 2024
0500a12
Use the matrix Python in the simple run.
facundobatista Mar 2, 2024
d3e8da5
Install setuptools using the matrix Python.
facundobatista Mar 2, 2024
a0da9d5
Disabled untill 411.
facundobatista Mar 2, 2024
f645dd1
Try to find exec path in windows.
facundobatista Mar 2, 2024
8fb87df
Try to find exec path in windows, 2.
facundobatista Mar 2, 2024
21e0ae9
Try to find exec path in windows, 3.
facundobatista Mar 2, 2024
9cd821a
Try to find exec path in windows, 4.
facundobatista Mar 2, 2024
491c4cb
Full use of the provided python path.
facundobatista Mar 2, 2024
03a6eb3
Removed debug line.
facundobatista Mar 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions .github/workflows/integtests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Integration Tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

archlinux:
runs-on: ubuntu-latest
container:
image: archlinux:latest
volumes:
- ${{ github.workspace }}:/fades
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
pacman -Sy --noconfirm python3 python-setuptools
- name: Simple fades run
run: |
cd /fades
bin/fades -v -d pytest -x pytest --version
# XXX Facundo 2024-03-01: "using a different Python" is missing here because Arch is hard

fedora:
runs-on: ubuntu-latest
container:
image: fedora:latest
volumes:
- ${{ github.workspace }}:/fades
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: |
yum install --assumeyes python3.12 python3-setuptools
- name: Simple fades run
run: |
cd /fades
bin/fades -v -d pytest -x pytest --version
- name: Using a different Python
run: |
# XXX Facundo 2024-02-29 - remove virtualenv in this install as part of issue #411 work
yum install --assumeyes python3.9 python3-virtualenv
cd /fades
export TEST_PYTHON_VERSION=3.9
python3.12 bin/fades -v --python=python3.9 -d pytest -x pytest -v tests/integtest.py

native:
strategy:
matrix:
# just a selection otherwise it's too much
# - latest OSes
# - oldest and newest Python
os: [ubuntu-22.04, macos-12, windows-2022]
python-version: [3.8, "3.12"]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v5
id: matrixpy
with:
python-version: ${{ matrix.python-version }}

# XXX Facundo 2024-03-02 - disabled until we enable the cross test below
# - name: Also set up Python 3.10 for cross-Python test
# uses: actions/setup-python@v4
# with:
# python-version: "3.10"

- name: Install dependencies
run: |
${{ steps.matrixpy.outputs.python-path }} -m pip install -U setuptools
- name: Simple fades run
run: |
${{ steps.matrixpy.outputs.python-path }} bin/fades -v -d pytest -x pytest --version

# XXX Facundo 2024-03-02 - commented out as until we finish issue #411 work we need 'virtualenv' and it's a
# hassle to install it in a multiplatform way -- this should be enabled while working on that issue
# - name: Using a different Python
# run: |
# export TEST_PYTHON_VERSION=3.10
# ${{ steps.matrixpy.outputs.python-path }} bin/fades -v --python=python3.10 -d pytest -x pytest -v tests/integtest.py
31 changes: 31 additions & 0 deletions tests/integtest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2024 Facundo Batista, Nicolás Demarchi
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranties of
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# For further info, check https://github.com/PyAr/fades

"""Helper to run integration tests.

This is not part of the regular test suite, but a test that is used in a very specific
way from the integration tests defined in the Github CI infrastructure.
"""

import os
import sys


def test_assert_python_version():
expected = os.environ["TEST_PYTHON_VERSION"]
vi = sys.version_info
current = f"{vi.major}.{vi.minor}"
assert current == expected
Loading