README.md 3.18 KB
Newer Older
Marc Egger's avatar
Marc Egger committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Tested on Ubuntu 16.04 with Docker version 18.09.2

# Other Documentation

More documentation and docker tips are located in:

- https://wikiit.math.uzh.ch/it/bestpractice/Docker
- https://systemvcs.math.uzh.ch/megger/qfq_docker

# Build Images

1. Clone the docker image repository:  
```git clone https://systemvcs.math.uzh.ch/megger/qfq_docker.git```

2. Build images as explained in the README.md of the image repository.
For the below scripts to work please name the images ```python-selenium``` and ```typo3-qfq``` respectively.

# Run and Interact with Containers

## Run qfq in docker container from scratch

1. clone qfq git project
Carsten  Rose's avatar
Carsten Rose committed
23 24 25

   ```git clone https://git.math.uzh.ch/typo3/qfq```
   
Marc Egger's avatar
Marc Egger committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
2. change to project directory (qfq)
3. ```make bootstrap```
4. ``` cd docker```
5. ```./run_qfq_docker.sh```
6. open the newly generated file run_qfq_docker.output and copy the value of T3_PORT. In a browser go to 127.0.0.1:<T3_PORT>.

## Deploy qfq extension changes to running container

Assumes you have run qfq in docker as explained above.

1. change to docker directory
2. ```./deploy_to_container.sh```

## Dump QFQ and (truncated) Typo3 databases to docker directory

Assumes you have run qfq in docker as explained above.

1. again from the docker directory run  
```./dump_databases.sh``` (this will overwrite the db_fixtrue_*.sql files)

## Run Phpmyadmin

ATTENTION: Use Firefox if Phpmyadmin login does not work in Chrome!

Assumes you have run qfq in docker as explained above.

1. change to docker directory and run ```./run_phpmyadmin.sh```
2. open the file run_qfq_docker.output and copy the value of PMA_PORT. In a browser (Firefox) go to 127.0.0.1:<PMA_PORT>.

## Run selenium tests on local machine (with visible browser)

Assumes you have run qfq in docker as explained above.

59
0. Install selenium for python:  ```python3 -m pip install --user selenium```
Marc Egger's avatar
Marc Egger committed
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
1. again from the docker directory run ```./run_selenium_tests_local.sh```

## Run a single selenium test file on local machine

Assumes you have run qfq in docker as explained above.

1. copy T3_PORT from docker/run_qfq_docker.output
2. Export variables (replace <T3_PORT>):  
```export SELENIUM_URL="http://127.0.0.1:<T3_PORT>" SELENIUM_HEADLESS="no"```
3. in extension/Tests/selenium run
```python <selenium test file>.py```

## Run selenium tests in docker container (test execution not visible)

Assumes you have run qfq in docker as explained above.

1. from the docker directory run ```./run_selenium_tests_docker.sh```

## Permanently remove all above created containers and their data

(only removes the containers listed in run_qfq_docker.output)

1. from the docker directory run ```./remove-containers.sh```

# TROUBLE SHOOT

## WebDriverException: Message: 'chromedriver' executable needs to be in PATH

1. Download Chromedriver:  
```wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`/chromedriver_linux64.zip```

2. Unzip chromedriver to current working directory  
```unzip /tmp/chromedriver.zip chromedriver```

3. export chromedriver path environment variable before running selenium tests locally  
Carsten  Rose's avatar
Carsten Rose committed
95
```export CHROMEDRIVER_PATH=<absolute path to chromedriver>/chromedriver```