@@ -59,82 +59,66 @@ jobs:
5959 with :
6060 python-version : " 3.10"
6161
62- - name : Install pytest
63- run : python3 -m pip install pytest
62+ # FIXME: The test_bootstrap.py script has duplicated logic to run build
63+ # and start images and run things in them. This makes tests slower,
64+ # and adds code to maintain. Let's try to remove it.
65+ #
66+ # - bootstrap.py's failure detections, put in unit tests?
67+ # - bootstrap.py's --show-progress-page test, include as integration test?
68+ #
69+ - name : Install integration-tests/requirements.txt for test_bootstrap.py
70+ run : pip install -r integration-tests/requirements.txt
6471
65- # We abort pytest after two failures as a compromise between wanting to
66- # avoid a flood of logs while still understanding if multiple tests would
67- # fail.
6872 - name : Run bootstrap tests (Runs in/Builds ${{ matrix.distro_image }} derived image)
6973 run : |
70- pytest --verbose --maxfail=2 --color=yes --durations=10 --capture=no \
71- integration-tests/test_bootstrap.py
72- timeout-minutes : 20
74+ pytest integration-tests/test_bootstrap.py
75+ timeout-minutes : 10
7376 env :
7477 # integration-tests/test_bootstrap.py will build and start containers
7578 # based on this environment variable. This is similar to how
7679 # .github/integration-test.py build-image can take a --build-arg
7780 # setting the base image via a Dockerfile ARG.
7881 BASE_IMAGE : ${{ matrix.distro_image }}
7982
80- # We build a docker image from wherein we will work
81- - name : Build systemd image (Builds ${{ matrix.distro_image }} derived image)
83+ - name : Build systemd image, derived from ${{ matrix.distro_image }}
8284 run : |
8385 .github/integration-test.py build-image \
8486 --build-arg "BASE_IMAGE=${{ matrix.distro_image }}"
8587
86- # FIXME: Make the logic below easier to follow.
87- # - In short, setting BOOTSTRAP_PIP_SPEC here, specifies from what
88- # location the tljh python package should be installed from. In this
89- # GitHub Workflow's test job, we provide a remote reference to itself as
90- # found on GitHub - this could be the HEAD of a PR branch or the default
91- # branch on merge.
92- #
9388 # Overview of how this logic influences the end result.
9489 # - integration-test.yaml:
95- # Runs integration-test.py by passing --bootstrap-pip-spec flag with a
96- # reference to the pull request on GitHub.
97- # - integration-test.py:
98- # Starts a pre-build systemd container, setting the
99- # TLJH_BOOTSTRAP_PIP_SPEC based on its passed --bootstrap-pip-spec value.
100- # - systemd container:
101- # Runs bootstrap.py
102- # - bootstrap.py
103- # Makes use of TLJH_BOOTSTRAP_PIP_SPEC environment variable to install
104- # the tljh package from a given location, which could be a local git
105- # clone of this repo where setup.py resides, or a reference to some
106- # GitHub branch for example.
107- - name : Set BOOTSTRAP_PIP_SPEC value
108- run : |
109- BOOTSTRAP_PIP_SPEC="git+https://github.com/$GITHUB_REPOSITORY.git@$GITHUB_REF"
110- echo "BOOTSTRAP_PIP_SPEC=$BOOTSTRAP_PIP_SPEC" >> $GITHUB_ENV
111- echo $BOOTSTRAP_PIP_SPEC
112-
113- - name : Run basic tests (Runs in ${{ matrix.distro_image }} derived image)
90+ #
91+ # - Runs integration-test.py build-image, to build a systemd based image
92+ # to use later.
93+ #
94+ # - Runs integration-test.py run-tests, to start a systemd based
95+ # container, run the bootstrap.py script inside it, and then run
96+ # pytest from the hub python environment setup by the bootstrap
97+ # script.
98+ #
99+ # About passed --installer-args:
100+ #
101+ # - --admin admin:admin
102+ # Required for test_admin_installer.py
103+ #
104+ # - --plugin /srv/src/integration-tests/plugins/simplest
105+ # Required for test_simplest_plugin.py
106+ #
107+ - name : pytest integration-tests/
108+ id : integration- tests
114109 run : |
115- .github/integration-test.py run-test basic-tests \
116- --bootstrap-pip-spec "$BOOTSTRAP_PIP_SPEC" \
110+ .github/integration-test.py run-test integration-tests \
111+ --installer-args "--admin test-admin-username:test-admin-password" \
112+ --installer-args "--plugin /srv/src/integration-tests/plugins/simplest" \
117113 ${{ matrix.extra_flags }} \
118114 test_hub.py \
119115 test_proxy.py \
120116 test_install.py \
121- test_extensions.py
122- timeout-minutes : 15
123-
124- - name : Run admin tests (Runs in ${{ matrix.distro_image }} derived image)
125- run : |
126- .github/integration-test.py run-test admin-tests \
127- --installer-args "--admin admin:admin" \
128- --bootstrap-pip-spec "$BOOTSTRAP_PIP_SPEC" \
129- ${{ matrix.extra_flags }} \
130- test_admin_installer.py
131- timeout-minutes : 15
132-
133- - name : Run plugin tests (Runs in ${{ matrix.distro_image }} derived image)
134- run : |
135- .github/integration-test.py run-test plugin-tests \
136- --bootstrap-pip-spec "$BOOTSTRAP_PIP_SPEC" \
137- --installer-args "--plugin /srv/src/integration-tests/plugins/simplest" \
138- ${{ matrix.extra_flags }} \
117+ test_extensions.py \
118+ test_admin_installer.py \
139119 test_simplest_plugin.py
140120 timeout-minutes : 15
121+ - name : show logs
122+ if : always() && steps.integration-tests.outcome != 'skipped'
123+ run : |
124+ .github/integration-test.py show-logs integration-tests
0 commit comments