kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
				
				
				
			Make api docker image able to run tests
							rodzic
							
								
									046648ce6c
								
							
						
					
					
						commit
						99f33dd392
					
				| 
						 | 
				
			
			@ -0,0 +1,7 @@
 | 
			
		|||
#!/bin/bash
 | 
			
		||||
set -e
 | 
			
		||||
if [ $1 = "pytest" ]; then
 | 
			
		||||
    # let pytest.ini handle it
 | 
			
		||||
    unset DJANGO_SETTINGS_MODULE
 | 
			
		||||
fi
 | 
			
		||||
exec "$@"
 | 
			
		||||
| 
						 | 
				
			
			@ -19,10 +19,6 @@ CACHES = {
 | 
			
		|||
 | 
			
		||||
CELERY_BROKER_URL = 'memory://'
 | 
			
		||||
 | 
			
		||||
# TESTING
 | 
			
		||||
# ------------------------------------------------------------------------------
 | 
			
		||||
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
 | 
			
		||||
 | 
			
		||||
########## CELERY
 | 
			
		||||
# In development, all tasks will be executed locally by blocking until the task returns
 | 
			
		||||
CELERY_TASK_ALWAYS_EAGER = True
 | 
			
		||||
| 
						 | 
				
			
			@ -30,3 +26,4 @@ CELERY_TASK_ALWAYS_EAGER = True
 | 
			
		|||
 | 
			
		||||
# Your local stuff: Below this line define 3rd party library settings
 | 
			
		||||
API_AUTHENTICATION_REQUIRED = False
 | 
			
		||||
CACHEOPS_ENABLED = False
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -23,3 +23,4 @@ RUN pip install -r /requirements/test.txt
 | 
			
		|||
 | 
			
		||||
COPY . /app
 | 
			
		||||
WORKDIR /app
 | 
			
		||||
ENTRYPOINT ["compose/django/dev-entrypoint.sh"]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										18
									
								
								api/test.yml
								
								
								
								
							
							
						
						
									
										18
									
								
								api/test.yml
								
								
								
								
							| 
						 | 
				
			
			@ -1,18 +0,0 @@
 | 
			
		|||
version: '2'
 | 
			
		||||
services:
 | 
			
		||||
  test:
 | 
			
		||||
    build:
 | 
			
		||||
      dockerfile: docker/Dockerfile.test
 | 
			
		||||
      context: .
 | 
			
		||||
    command: pytest
 | 
			
		||||
    depends_on:
 | 
			
		||||
      - postgres
 | 
			
		||||
    volumes:
 | 
			
		||||
      - .:/app
 | 
			
		||||
    environment:
 | 
			
		||||
      - "DJANGO_ALLOWED_HOSTS=localhost"
 | 
			
		||||
      - "DATABASE_URL=postgresql://postgres@postgres/postgres"
 | 
			
		||||
      - "FUNKWHALE_URL=https://funkwhale.test"
 | 
			
		||||
      - "CACHEOPS_ENABLED=False"
 | 
			
		||||
  postgres:
 | 
			
		||||
    image: postgres
 | 
			
		||||
		Ładowanie…
	
		Reference in New Issue