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

Add docs to run integration-tests #2317

Closed
b4handjr opened this issue Feb 26, 2020 · 8 comments
Closed

Add docs to run integration-tests #2317

b4handjr opened this issue Feb 26, 2020 · 8 comments
Assignees
Labels
Enhancement new / change to feature or function https://mozilla.github.io/task-defect-enhancement/index.html Task https://mozilla.github.io/task-defect-enhancement/index.html

Comments

@b4handjr
Copy link
Contributor

There are currently no docs on how to run the integration-test suite. We should fix that by adding docs on how they can be run locally.

@b4handjr b4handjr added Task https://mozilla.github.io/task-defect-enhancement/index.html Enhancement new / change to feature or function https://mozilla.github.io/task-defect-enhancement/index.html labels Feb 26, 2020
@b4handjr b4handjr added this to the 2.52.0 milestone Feb 26, 2020
@b4handjr b4handjr self-assigned this Feb 26, 2020
@b4handjr
Copy link
Contributor Author

b4handjr commented Feb 26, 2020

Here is what I have so far:

Experimenter Integration Tests

Prerequisites

Setup using docker and make

To run the tests via docker-compose use the following make commands.

  • Start and run the tests
make integration_test_run

You can view the tests running via VNC and port 5900. The password to connect to the container is secret.
To trigger the tests within the container:

docker-compose -p experimenter_integration -f docker-compose.yml -f docker-compose.integration-test.yml exec firefox sh -c "tox -c tests/integration"

With the VNC window open, you should see Firefox open and Selenium executing commands.

Setup using local Firefox

Install geckodriver in your path. You should be able to do geckodriver --version from your terminal if your path is correct. Firefox must also be available from
your path. To verify this use the following command: firefox --version. If there is no output check your configuration.

Now navigate to the directory that you have cloned experimenter into and follow these steps:

  1. Within the experimenter root directory:
mkdir python_env
python3 -m venv python_env
source python_env/bin/activate

If successful your shell should have an (python_env) prefix.
2. Install Tox

pip install tox
  1. Start the tests
tox -c tests/integration/tox.ini

Firefox should open and the tests should execute.

Extras

  • To run a single test with tox you must pass the arguments through tox using -- and then use the keyword argument within pytest.
    Ex: tox -c tests/integration -- -k name_of_test
  • To deactivate the virtual env: source deactivate
  • Setup and start containers but do not run tests: make integration_up_detached
  • Setup and start containers but do not run tests and show all container messages: make integration_up
  • Kill all containers: make kill

@uhlissuh
Copy link
Contributor

uhlissuh commented Mar 4, 2020

Hey I edited your comment because it had an errant "```" that was messing up the formatting... hope you don't mind.

I tried your steps for local setup and they seem like they will work.... unfortunately though, I got all the way to seeing the first test listed and attempt to run... then it all just stalled indefinitely. Assuming this is a geckodriver issue? I'm gonna take another stab at it tomorrow to see if I can't get everything, and in particular geckodriver, set up correctly. I definitely think running locally is going to be the simplest and best way to run the the integration tests... This is what I'm seeing at the moment:

inttest

@b4handjr
Copy link
Contributor Author

b4handjr commented Mar 5, 2020

@uhlissuh can you try and just let it run until it fails? If it doesn't fail after 5 min let me know here please. Thanks.

@jaredlockhart jaredlockhart modified the milestones: 2.53.0, 2.54.0 Mar 10, 2020
@uhlissuh
Copy link
Contributor

uhlissuh commented Mar 16, 2020

If I wait, they'll all error out with this connection error:

Screen Shot 2020-03-16 at 10 23 58 AM

@b4handjr
Copy link
Contributor Author

If I wait, they'll all error out with this connection error:

Uploading Screen Shot 2020-03-16 at 10.23.58 AM.png…

I don't think this image uploaded correctly, can you try again please?

@uhlissuh
Copy link
Contributor

sorry @jrbenny35, I fixed it.

@b4handjr
Copy link
Contributor Author

Did you make any changes to the URL within the tox file? Is experimenter accessible at http://nginx in your browser?

@tiftran tiftran modified the milestones: 2.54.0, 2.55.0 Mar 17, 2020
@jaredlockhart jaredlockhart removed this from the 2.55.0 milestone Mar 25, 2020
@jaredlockhart
Copy link
Collaborator

Closing this until it comes up again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement new / change to feature or function https://mozilla.github.io/task-defect-enhancement/index.html Task https://mozilla.github.io/task-defect-enhancement/index.html
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants