test_e2e
This commit is contained in:
		
							parent
							
								
									35f947376b
								
							
						
					
					
						commit
						b58f029f83
					
				
					 3 changed files with 65 additions and 1 deletions
				
			
		|  | @ -97,6 +97,22 @@ local jobs = { | |||
|      'yarn test' | ||||
|      ] }, | ||||
| 
 | ||||
|   // Integration API | ||||
|   local integration_test = baseJob.EndToEndTest { | ||||
|     stage: stages.unit_tests | ||||
|   }, | ||||
| 
 | ||||
|   'demo_e2e':  integration_test { | ||||
|     script: [ | ||||
|        "python initdb.py", | ||||
|        "sleep 30", | ||||
|        "curl localhost:80/cnr/version", | ||||
|        "sleep 30", | ||||
|        "curl localhost:80", | ||||
|        "sleep 30", | ||||
|        "curl localhost:80/status", | ||||
|       ] | ||||
|   }, | ||||
|   // Unit-tests with real databases | ||||
|   local db_stage = { stage: stages.unit_tests }, | ||||
|   local dbname = 'quay', | ||||
|  |  | |||
|  | @ -51,6 +51,37 @@ container-release: | |||
|   variables: | ||||
|     DOCKER_DRIVER: overlay | ||||
|     DOCKER_HOST: tcp://docker-host.gitlab-runner.svc.cluster.local:2375 | ||||
| demo_e2e: | ||||
|   before_script: | ||||
|   - cd $QUAYDIR | ||||
|   - source $QUAYDIR/venv/bin/activate | ||||
|   - sleep 30 | ||||
|   - alembic upgrade head | ||||
|   image: quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG} | ||||
|   script: | ||||
|   - python initdb.py | ||||
|   - sleep 30 | ||||
|   - curl localhost:80/cnr/version | ||||
|   - sleep 30 | ||||
|   - curl localhost:80 | ||||
|   - sleep 30 | ||||
|   - curl localhost:80/status | ||||
|   services: | ||||
|   - postgres:9.6 | ||||
|   - quay.io/quay/quay-ci:${CI_COMMIT_REF_SLUG} | ||||
|   stage: unit_tests | ||||
|   tags: | ||||
|   - kubernetes | ||||
|   variables: | ||||
|     DB_URI: postgresql://quay:quay@localhost/quay | ||||
|     GIT_STRATEGY: none | ||||
|     POSTGRES_PASSWORD: quay | ||||
|     POSTGRES_USER: quay | ||||
|     PYTHONPATH: . | ||||
|     QUAYDIR: /quay-registry | ||||
|     SKIP_DB_SCHEMA: 'true' | ||||
|     TEST: 'true' | ||||
|     TEST_DATABASE_URI: postgresql://quay:quay@localhost/quay | ||||
| deploy-preview: | ||||
|   before_script: | ||||
|   - appr login -u $DOCKER_USER -p $DOCKER_PASS quay.io | ||||
|  |  | |||
|  | @ -35,7 +35,6 @@ function(vars={}) | |||
|       ], | ||||
|     }, | ||||
| 
 | ||||
| 
 | ||||
|     QuayDeploy: { | ||||
|       local this = self, | ||||
|       local _vars = self.localvars, | ||||
|  | @ -99,6 +98,24 @@ function(vars={}) | |||
|       }, | ||||
|       before_script: [], | ||||
|       script: [], | ||||
|    }, | ||||
| 
 | ||||
|     EndToEndTest: self.QuayTest { | ||||
|       services: [ | ||||
|       "postgres:9.6", | ||||
|       vars.images.quayci.name, | ||||
|       ], | ||||
|       before_script+: [ | ||||
|       "sleep 30", | ||||
|       "alembic upgrade head", | ||||
|       ], | ||||
|       variables+: { | ||||
|         POSTGRES_PASSWORD: "quay", | ||||
|         POSTGRES_USER: "quay", | ||||
|         SKIP_DB_SCHEMA: 'true', | ||||
|         TEST_DATABASE_URI: self['DB_URI'], | ||||
|         DB_URI: 'postgresql://quay:quay@localhost/quay' | ||||
|       }, | ||||
|     }, | ||||
| 
 | ||||
|     dbTest(scheme, image, env):: self.QuayTest { | ||||
|  |  | |||
		Reference in a new issue