Skip to content

Commit

Permalink
ci: add fixme statements and organize for comprehension
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Oct 20, 2021
1 parent 4a8308b commit 6cb3172
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 14 deletions.
50 changes: 36 additions & 14 deletions .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,13 @@ jobs:
with:
python-version: ${{ matrix.python_version }}

- name: Set BOOTSTRAP_PIP_SPEC value
run: |
echo "BOOTSTRAP_PIP_SPEC=git+https://github.com/$GITHUB_REPOSITORY.git@$GITHUB_REF" >> $GITHUB_ENV
echo $BOOTSTRAP_PIP_SPEC
- name: Build systemd image
run: |
.github/integration-test.py build-image \
--build-arg "ubuntu_version=${{ matrix.ubuntu_version }}"
- name: Install pytest
run: python3 -m pip install pytest

# We abort pytest after two failures as a compromise between wanting to
# avoid a flood of logs while still understanding if multiple tests would
# fail.
- name: Run bootstrap tests
- name: Run bootstrap tests (Runs in/Builds ubuntu:${{ matrix.ubuntu_version }} derived image)
run: |
pytest --verbose --maxfail=2 --color=yes --durations=10 --capture=no \
integration-tests/test_bootstrap.py
Expand All @@ -130,7 +120,39 @@ jobs:
# setting the ubuntu_version.
UBUNTU_VERSION: ${{ matrix.ubuntu_version }}

- name: Run basic tests
# We build a docker image from wherein we will work
- name: Build systemd image (Builds ubuntu:${{ matrix.ubuntu_version }} derived image)
run: |
.github/integration-test.py build-image \
--build-arg "ubuntu_version=${{ matrix.ubuntu_version }}"
# FIXME: Make the logic below easier to follow.
# - In short, setting BOOTSTRAP_PIP_SPEC here, specifies from what
# location the tljh python package should be installed from. In this
# GitHub Workflow's test job, we provide a remote reference to itself as
# found on GitHub - this could be the HEAD of a PR branch or the default
# branch on merge.
#
# Overview of how this logic influences the end result.
# - integration-test.yaml:
# Runs integration-test.py by passing --bootstrap-pip-spec flag with a
# reference to the pull request on GitHub.
# - integration-test.py:
# Starts a pre-build systemd container, setting the
# TLJH_BOOTSTRAP_PIP_SPEC based on its passed --bootstrap-pip-spec value.
# - systemd container:
# Runs bootstrap.py
# - bootstrap.py
# Makes use of TLJH_BOOTSTRAP_PIP_SPEC environment variable to install
# the tljh package from a given location, which could be a local git
# clone of this repo where setup.py resides, or a reference to some
# GitHub branch for example.
- name: Set BOOTSTRAP_PIP_SPEC value
run: |
echo "BOOTSTRAP_PIP_SPEC=git+https://github.com/$GITHUB_REPOSITORY.git@$GITHUB_REF" >> $GITHUB_ENV
echo $BOOTSTRAP_PIP_SPEC
- name: Run basic tests (Runs in ubuntu:${{ matrix.ubuntu_version }} derived image)
run: |
.github/integration-test.py run-test basic-tests \
--bootstrap-pip-spec "$BOOTSTRAP_PIP_SPEC" \
Expand All @@ -141,7 +163,7 @@ jobs:
test_extensions.py
timeout-minutes: 15

- name: Run admin tests
- name: Run admin tests (Runs in ubuntu:${{ matrix.ubuntu_version }} derived image)
run: |
.github/integration-test.py run-test admin-tests \
--installer-args "--admin admin:admin" \
Expand All @@ -150,7 +172,7 @@ jobs:
test_admin_installer.py
timeout-minutes: 15

- name: Run plugin tests
- name: Run plugin tests (Runs in ubuntu:${{ matrix.ubuntu_version }} derived image)
run: |
.github/integration-test.py run-test plugin-tests \
--bootstrap-pip-spec "$BOOTSTRAP_PIP_SPEC" \
Expand Down
7 changes: 7 additions & 0 deletions integration-tests/test_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ def get_bootstrap_script_location(container_name, show_progress_page):
# - github: configures bootstrap to install tljh from the official github repo
# - <pip spec>: configures bootstrap to install tljh from any given remote location
# - param: bootstrap_flags
#
# FIXME: Consider stripping logic in this file to only testing if the bootstrap
# script successfully detects the too old Ubuntu version and the lack of
# systemd. The remaining test named test_progress_page could rely on
# running against the systemd container that cab be built by
# integration-test.py.
#
def run_bootstrap_after_preparing_container(container_name, image, show_progress_page=False):
"""
1. Stops old container
Expand Down

0 comments on commit 6cb3172

Please sign in to comment.