CI - test packaged version of fittrackee
This commit is contained in:
		
							
								
								
									
										52
									
								
								.github/workflows/.tests-python.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										52
									
								
								.github/workflows/.tests-python.yml
									
									
									
									
										vendored
									
									
								
							@@ -129,3 +129,55 @@ jobs:
 | 
				
			|||||||
          sleep 5
 | 
					          sleep 5
 | 
				
			||||||
          nohup flask worker --processes=1 >> nohup.out 2>&1 &
 | 
					          nohup flask worker --processes=1 >> nohup.out 2>&1 &
 | 
				
			||||||
          pytest e2e --driver Remote --capability browserName firefox --selenium-host selenium --selenium-port 4444
 | 
					          pytest e2e --driver Remote --capability browserName firefox --selenium-host selenium --selenium-port 4444
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  end2end_package:
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					    needs: ["python"]
 | 
				
			||||||
 | 
					    container: python:3.10
 | 
				
			||||||
 | 
					    services:
 | 
				
			||||||
 | 
					      postgres:
 | 
				
			||||||
 | 
					        image: postgres:14
 | 
				
			||||||
 | 
					        env:
 | 
				
			||||||
 | 
					          POSTGRES_DB: fittrackee_test
 | 
				
			||||||
 | 
					          POSTGRES_USER: fittrackee
 | 
				
			||||||
 | 
					          POSTGRES_PASSWORD: fittrackee
 | 
				
			||||||
 | 
					        options: >-
 | 
				
			||||||
 | 
					          --health-cmd pg_isready
 | 
				
			||||||
 | 
					          --health-interval 10s
 | 
				
			||||||
 | 
					          --health-timeout 5s
 | 
				
			||||||
 | 
					          --health-retries 5
 | 
				
			||||||
 | 
					      selenium:
 | 
				
			||||||
 | 
					        image: selenium/standalone-firefox
 | 
				
			||||||
 | 
					      mailhog:
 | 
				
			||||||
 | 
					        image: mailhog/mailhog:latest
 | 
				
			||||||
 | 
					      redis:
 | 
				
			||||||
 | 
					        image: redis:latest
 | 
				
			||||||
 | 
					    env:
 | 
				
			||||||
 | 
					      APP_SETTINGS: fittrackee.config.End2EndTestingConfig
 | 
				
			||||||
 | 
					      EMAIL_URL: "smtp://mailhog:1025"
 | 
				
			||||||
 | 
					      REDIS_URL: "redis://redis:6379"
 | 
				
			||||||
 | 
					      HOST: "0.0.0.0"
 | 
				
			||||||
 | 
					      PORT: 5000
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					      - uses: actions/checkout@v2
 | 
				
			||||||
 | 
					      - name: Update pip and install build
 | 
				
			||||||
 | 
					        run: python3 -m pip install --upgrade pip build
 | 
				
			||||||
 | 
					      - name: Create and source virtual environment
 | 
				
			||||||
 | 
					        run: | 
 | 
				
			||||||
 | 
					          python3 -m venv .venv 
 | 
				
			||||||
 | 
					          . .venv/bin/activate
 | 
				
			||||||
 | 
					      - name: Build fittrackee package
 | 
				
			||||||
 | 
					        run: python3 -m build
 | 
				
			||||||
 | 
					      - name: Install fittrackee package
 | 
				
			||||||
 | 
					        run: python3 -m pip install dist/fittrackee-$(cat VERSION).tar.gz
 | 
				
			||||||
 | 
					      - name: Run migrations
 | 
				
			||||||
 | 
					        run: ftcli db upgrade
 | 
				
			||||||
 | 
					      - name: Install pytest and selenium
 | 
				
			||||||
 | 
					        run: python3 -m pip install pytest==7.4.0 pytest-selenium==4.0.1 selenium==4.9.0
 | 
				
			||||||
 | 
					      - name: Start application and run tests with Selenium
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          setsid nohup fittrackee >> nohup.out 2>&1 &
 | 
				
			||||||
 | 
					          export TEST_APP_URL=http://$(hostname --ip-address):5000
 | 
				
			||||||
 | 
					          sleep 5
 | 
				
			||||||
 | 
					          nohup flask worker --processes=1 >> nohup.out 2>&1 &
 | 
				
			||||||
 | 
					          pytest e2e --driver Remote --capability browserName firefox --selenium-host selenium --selenium-port 4444
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user