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

🐛(tests) configure DRF in lms settings & use lms settings in tests #9

Merged
merged 1 commit into from
Mar 27, 2018

Conversation

jmaupetit
Copy link
Contributor

@jmaupetit jmaupetit commented Mar 13, 2018

Purpose

We need to use lms settings in our tests so that we are in an Open edX context.

Proposal

  • Configure DRF URL path versioning in lms settings
  • Test allowed API version
  • Switch tests settings to lms docker settings
  • Populate test database in Fonzie test suite
  • Remove tox

@jmaupetit jmaupetit changed the title Fix api versionning fix(api) configure DRF in lms settings & use lms settings in tests Mar 13, 2018
@jmaupetit jmaupetit force-pushed the fix-api-versionning branch 3 times, most recently from 16ed908 to 3125e5c Compare March 16, 2018 13:54
@jmaupetit jmaupetit requested a review from sampaccoud March 16, 2018 14:24
@jmaupetit jmaupetit self-assigned this Mar 16, 2018
@jmaupetit jmaupetit added this to the 0.1.0 milestone Mar 16, 2018
@jmaupetit jmaupetit force-pushed the fix-api-versionning branch from 3125e5c to dfb46ca Compare March 19, 2018 07:52
RUN if [ ${user} -ne 0 -a ${group} -ne 0 ]; then \
groupadd --gid $group app ; \
useradd --uid $user --gid $group --home /app app ; \
fi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use redhat pattern as we don't want to create images that work only with one user?

Copy link
Contributor Author

@jmaupetit jmaupetit Mar 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't mind I would prefer to handle this in a new PR as it requires substantial changes. I'll declare a new issue for this. Deal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FTR #11

- CI_STEP=quality
- CI_STEP=docs
- CI_STEP=test
- CI_STEP=test-spec OPENEDX_RELEASE=ginkgo.1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought you were removing Travis?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will. Not in this PR. I'll declare another issue for this. Deal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FTR #10

echo "Running tox:$TOXENV test suite..."
# Perform database migrations
echo "Starting database migration"
_dc_run lms python ./manage.py lms migrate

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cms migrations?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fonzie is installed in the LMS application. Is the LMS standalone, or does it requires the CMS to run?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok so maybe remove it from elsewhere?

bin/ci Outdated
;;
test)
make test
;;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 95 -> 103 ca be replaced by
docs|quality|test)
make $CI_STEP
;;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Thx!

@jmaupetit jmaupetit changed the title fix(api) configure DRF in lms settings & use lms settings in tests ✌️(api) configure DRF in lms settings & use lms settings in tests Mar 23, 2018
** FIX DETAILS **

* configure & test DRF API versioning
* use lms settings in tests
* get rid of tox in our CI:

Using tox within docker containers seems overkill; let's make things a
little bit "simpler" by dropping it once for all.

* Prevent root user creation:

when trying to build the base container with no user or group as build
arguments, docker tries to create the root user. We prevent this
behavior by only creating a user when uid:gid are distinct from root
user ids.

* Update volume endpoints:

fundocker/edxapp now use the same application tree as edx, we need to
stick to it to make it works.

** MISC **

* fix broken comparison in ci script
* use super() in test cases setUp method
* remove unused CMS service
* improve CI step switch/case
@jmaupetit jmaupetit force-pushed the fix-api-versionning branch from 13edc15 to c0980f4 Compare March 27, 2018 15:25
@jmaupetit jmaupetit changed the title ✌️(api) configure DRF in lms settings & use lms settings in tests 🐛(tests) configure DRF in lms settings & use lms settings in tests Mar 27, 2018
@jmaupetit jmaupetit merged commit 7bfaa33 into master Mar 27, 2018
@jmaupetit jmaupetit deleted the fix-api-versionning branch March 27, 2018 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants