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

temp: Try to run everything on Actions runnes. #34079

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .github/workflows/migrations-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
python-version: [ 3.8 ]
# 'pinned' is used to install the latest patch version of Django
# within the global constraint i.e. Django==3.2.21 in current case
# because we have global constraint of Django<4.2
# because we have global constraint of Django<4.2
django-version: ["pinned", "4.2"]
mongo-version: ["4"]
mysql-version: ["5.7", "8"]
# excluding mysql5.7 with Django 4.2 since Django 4.2 has
# excluding mysql5.7 with Django 4.2 since Django 4.2 has
# dropped support for MySQL<8
exclude:
- django-version: "4.2"
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
./manage.py lms migrate
echo "Running the CMS migrations."
./manage.py cms migrate

# This job aggregates test results. It's the required check for branch protection.
# https://github.com/marketplace/actions/alls-green#why
# https://github.com/orgs/community/discussions/33579
Expand Down
106 changes: 78 additions & 28 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,60 +10,110 @@ jobs:
run-tests:
name: python-${{ matrix.python-version }},django-${{ matrix.django-version }},${{ matrix.shard_name }}
if: (github.repository == 'edx/edx-platform-private') || (github.repository == 'openedx/edx-platform' && (startsWith(github.base_ref, 'open-release') == false))
runs-on: [ edx-platform-runner ]
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.8"
django-version:
- "pinned"
- "4.2"
mongo-version: ["4"]
mysql-version: ["8"]
# When updating the shards, remember to make the same changes in
# .github/workflows/unit-tests-gh-hosted.yml
shard_name:
- "lms-1"
- "lms-2"
- "lms-3"
- "lms-4"
- "lms-5"
- "lms-6"
- "openedx-1-with-lms"
- "openedx-2-with-lms"
- "openedx-1-with-cms"
- "openedx-2-with-cms"
- "cms-1"
- "cms-2"
- "common-with-lms"
- "common-with-cms"
- "xmodule-with-lms"
- "xmodule-with-cms"
# - "lms-2"
# - "lms-3"
# - "lms-4"
# - "lms-5"
# - "lms-6"
# - "openedx-1-with-lms"
# - "openedx-2-with-lms"
# - "openedx-1-with-cms"
# - "openedx-2-with-cms"
# - "cms-1"
# - "cms-2"
# - "common-with-lms"
# - "common-with-cms"
# - "xmodule-with-lms"
# - "xmodule-with-cms"
# We expect Django 4.0 to fail, so don't stop when it fails.
continue-on-error: ${{ matrix.django-version == '4.0' }}

services:
mongo:
image: mongo:${{ matrix.mongo-version }}
ports:
- 27017:27017
# Note: Calling `mongo` here only works with mongo 4, in newer versions of mongo
# we'll have to use `mongosh`
options: >-
--health-cmd "mongo --quiet --eval 'db.runCommand(\"ping\")'"
--health-interval 10s
--health-timeout 5s
--health-retries 3
mysql:
image: mysql:${{ matrix.mysql-version }}
ports:
- 3306:3306
env:
MYSQL_DATABASE: "edxapp"
MYSQL_USER: "edxapp001"
MYSQL_PASSWORD: "password"
MYSQL_RANDOM_ROOT_PASSWORD: true
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 3
steps:
- name: sync directory owner
run: sudo chown runner:runner -R .*
# - name: sync directory owner
# run: sudo chown runner:runner -R .*
# - name: Setup mongodb user
# run: |
# mongo edxapp --eval '
# db.createUser(
# {
# user: "edxapp",
# pwd: "password",
# roles: [
# { role: "readWrite", db: "edxapp" },
# ]
# }
# );
# '
#
# - name: Verify mongo and mysql db credentials
# run: |
# mysql -h 127.0.0.1 -uedxapp001 -ppassword -e "select 1;" edxapp
# mongo --host 127.0.0.1 --username edxapp --password password --eval 'use edxapp; db.adminCommand("ping");' edxapp


- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: checkout repo
uses: actions/checkout@v3

- name: start mongod server for tests
- name: Install system Packages
run: |
sudo mkdir -p /data/db
sudo chmod -R a+rw /data/db
mongod &
sudo apt-get update
make ubuntu-requirements

- name: install requirements
run: |
sudo make test-requirements
make test-requirements
if [[ "${{ matrix.django-version }}" != "pinned" ]]; then
sudo pip install "django~=${{ matrix.django-version }}.0"
sudo pip check # fail if this test-reqs/Django combination is broken
pip install "django~=${{ matrix.django-version }}.0"
pip check # fail if this test-reqs/Django combination is broken
fi

- name: list installed package versions
run: |
sudo pip freeze
pip freeze

- name: Setup and run tests
uses: ./.github/actions/unit-tests
Expand Down Expand Up @@ -95,7 +145,7 @@ jobs:
jobs: ${{ toJSON(needs) }}

compile-warnings-report:
runs-on: [ edx-platform-runner ]
runs-on: ubuntu-latest
needs: [ run-tests ]
steps:
- name: sync directory owner
Expand Down
Loading