Skip to content

Commit

Permalink
Github Windows CI: Use bash, modernize
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Oct 20, 2024
1 parent f11f599 commit 1d8106a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 29 deletions.
34 changes: 19 additions & 15 deletions .ci/run-tests-for-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

set -e

echo "i18n"
# Testing i18n needs a local_settings file even though the rest of the tests
# don't use it
# collectstatic and i18n a local_settings file
cp local_settings_example.py local_settings.py

# Make sure i18n literals marked correctly
poetry run python manage.py makemessages --all
poetry run python manage.py compilemessages
echo "OSTYPE: $OSTYPE"
if [[ "$OSTYPE" != msys ]]; then
echo "i18n"
# Make sure i18n literals marked correctly
poetry run python manage.py makemessages --all
poetry run python manage.py compilemessages
fi

staticfiles=(
bundle-base.js
Expand All @@ -29,19 +31,21 @@ done

poetry run python manage.py collectstatic

echo "Starts testing"
rm local_settings.py

echo "Start testing"
export RELATE_LOCAL_TEST_SETTINGS="local_settings_example.py"

PYTEST_COMMON_FLAGS=(--tb=native)
PYTEST_COMMON_FLAGS=()

if test "$CI_SERVER_NAME" = "GitLab"; then
# I don't *really* know what's going on, but I observed EADDRNOTAVAIL
# when the tests try to connect to the code grading process.
#
# Sample failed job:
# https://gitlab.tiker.net/inducer/relate/-/jobs/159522
# -AK, 2020-09-01
PYTEST_COMMON_FLAGS+=(-k "not LanguageOverrideTest")
# I don't *really* know what's going on, but I observed EADDRNOTAVAIL
# when the tests try to connect to the code grading process.
#
# Sample failed job:
# https://gitlab.tiker.net/inducer/relate/-/jobs/159522
# -AK, 2020-09-01
PYTEST_COMMON_FLAGS+=(-k "not LanguageOverrideTest")
fi

if [[ "$RL_CI_TEST" = "expensive" ]]; then
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
# Pinned to 3.11 because of poetry issues with missing setuptools
# https://github.com/python-poetry/poetry/issues/7611#issuecomment-1793850783
python-version: '3.11'
python-version: '3.x'
- name: Install Poetry
uses: snok/[email protected]
with:
Expand All @@ -153,20 +151,10 @@ jobs:
run: |
poetry config virtualenvs.in-project true
- name: Install Dependencies
env:
SETUPTOOLS_USE_DISTUTILS: stdlib
run: |
# work around
# https://github.com/python-poetry/poetry/issues/7611#issuecomment-1747836233
# can be removed when
# https://github.com/python-poetry/poetry/pull/8517
# is merged and released
poetry config installer.max-workers 1
poetry install
- name: Run test suite
env:
RELATE_LOCAL_TEST_SETTINGS: "local_settings_example.py"
run: |
poetry run pytest -rxsw --tb=native
bash ./.ci/run-tests-for-ci.sh
# vim: sw=2

0 comments on commit 1d8106a

Please sign in to comment.