OpenDataServices / standards-lab

Open Standards Lab. A web tool for users and creators of Open Standards.
https://standards-lab.readthedocs.io/
GNU Affero General Public License v3.0
2 stars 0 forks source link

Run tests on Docker? #164

Open odscjames opened 3 years ago

odscjames commented 3 years ago

The docs say:

docker-compose run standards-lab-worker standards_lab/manage.py test standards_lab

I get an error:

FileNotFoundError: [Errno 2] No such file or directory: 'google-chrome'
odscjames commented 3 years ago

I tried adding the following to the Dockerfile:

# This needed for tests?? But not in Live!
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apt install ./google-chrome-stable_current_amd64.deb

But it won't install ....

The following packages have unmet dependencies:
 google-chrome-stable : ..................
odscjames commented 3 years ago

@rhiaro Wrote these section of docs so I'm going to ask her in the first instance, tho I'm aware she may not have written the relevant code

odscjames commented 3 years ago

I got it to work!

docker-compose  -f docker-compose.yml -f docker-compose.override.dev.yml   run standards-lab-worker bash
apt-get update
apt install -y chromium 
standards_lab/manage.py test standards_lab

Get error "(unknown error: DevToolsActivePort file doesn't exist)"

Open standards_lab/ui/tests_browser.py, add the line:

chrome_options.add_argument("--no-sandbox")

Tests now run! Verified by changing an assert statement and see it fail.

Also Note: Tests won't run unless Redis running, so to run tests you have to keep a general "docker-compose up" going.

Q to ppl working on project before: Am I missing something, is this meant to work a different way?

odscjames commented 3 years ago

See https://github.com/OpenDataServices/standards-lab/pull/171