Skip to content

Commit

Permalink
chore: enabling integration tests (#355)
Browse files Browse the repository at this point in the history
* chore: enabling integration tests

* fix: fixed all integration tests

* feat: added integration tests in CI workflow

* fix: some cleanup

* temp: added codecov.yml

* temp: changed codecov.yml

* temp: changed codecov.yml

* temp: removed codecov.yml

* refactor: removed the redundant submissions_api.get_scoresubmission call

* chore: updated xblock-sdk version to 0.9.0
  • Loading branch information
Anas12091101 authored Mar 26, 2024
1 parent 5f18e95 commit c9ba9c1
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 105 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
- name: Python setup
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

python-version: ${{ matrix.python-version }}
- name: tox install
run: pip install tox

Expand All @@ -36,9 +36,18 @@ jobs:
TOXENV: ${{ matrix.toxenv }}
run: tox

- name: Run Integration Tests
run: |
cd ..
git clone https://github.com/openedx/devstack
cd devstack
sed -i 's/:cached//g' ./docker-compose-host.yml
make dev.clone.https
DEVSTACK_WORKSPACE=$PWD/.. docker-compose -f docker-compose.yml -f docker-compose-host.yml run -v $PWD/../edx-sga:/edx-sga lms /edx-sga/run_devstack_integration_tests.sh
- name: Upload coverage to CodeCov
if: matrix.python-version == '3.8' && matrix.toxenv == 'py38-django42'
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
fail_ci_if_error: true
fail_ci_if_error: false
3 changes: 2 additions & 1 deletion edx_sga/sga.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def file_size_over_limit(cls, file_obj):

@classmethod
def parse_xml(cls, node, runtime, keys, id_generator):
# pylint: disable=arguments-differ,unused-argument
"""
Override default serialization to handle <solution /> elements
"""
Expand All @@ -190,7 +191,7 @@ def parse_xml(cls, node, runtime, keys, id_generator):
for child in node:
if child.tag == "solution":
# convert child elements of <solution> into HTML for display
block.solution = "".join(etree.tostring(subchild) for subchild in child)
block.solution = "".join(etree.tostring(subchild, encoding=str) for subchild in child)

# Attributes become fields.
# Note that a solution attribute here will override any solution XML element
Expand Down
Loading

0 comments on commit c9ba9c1

Please sign in to comment.