Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
400e805
commit 227fb99
Showing
94 changed files
with
2,001 additions
and
1,382 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
apiVersion: schemas.schemahero.io/v1alpha1 | ||
kind: Table | ||
metadata: | ||
name: projects | ||
spec: | ||
database: testdb | ||
name: projects | ||
requires: [] | ||
schema: | ||
postgres: | ||
primaryKey: [id] | ||
foreignKeys: | ||
- columns: | ||
- id | ||
references: | ||
table: users | ||
columns: | ||
- id | ||
columns: | ||
- name: id | ||
type: integer | ||
- name: user_id | ||
type: integer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
database: testdb | ||
name: projects | ||
requires: [] | ||
schema: | ||
postgres: | ||
primaryKey: [id] | ||
foreignKeys: | ||
- columns: | ||
- id | ||
references: | ||
table: users | ||
columns: | ||
- id | ||
columns: | ||
- name: id | ||
type: integer | ||
- name: name | ||
type: varchar(255) | ||
- name: user_id | ||
type: integer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
database: testdb | ||
name: users | ||
requires: [] | ||
schema: | ||
postgres: | ||
primaryKey: [id] | ||
columns: | ||
- name: id | ||
type: integer | ||
- name: login | ||
type: varchar(255) | ||
- name: name | ||
type: varchar(255) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
out/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,22 @@ | ||
export GO_BUILD=env GO111MODULE=on go build | ||
|
||
TAG ?= $(shell uuidgen) | ||
SHELL := /bin/bash | ||
IMAGE := "ttl.sh/$(shell uuidgen):1h" | ||
export IMAGE | ||
|
||
.PHONY: run | ||
run: build | ||
bin/schemahero-integration-tests run \ | ||
--manager-image-name "ttl.sh/sh/manager-$(TAG):1h" \ | ||
--schemahero-image-name "ttl.sh/sh/$(TAG):1h" | ||
run: build postgres mysql | ||
|
||
integration-test-image: | ||
docker build -t ttl.sh/sh/$(TAG):1h -f ../Dockerfile.schemahero .. | ||
docker build -t ttl.sh/sh/manager-$(TAG):1h -f ../Dockerfile.manager .. | ||
docker push ttl.sh/sh/$(TAG):1h | ||
docker push ttl.sh/sh/manager-$(TAG):1h | ||
.PHONY: postgres | ||
postgres: build | ||
# make -C tests/postgres/create-table run | ||
# make -C tests/postgres/foreign-key run | ||
|
||
.PHONY: mysql | ||
mysql: build | ||
# make -C tests/mysql/create-table run | ||
make -C tests/mysql/foreign-key run | ||
|
||
.PHONY: build | ||
build: GO111MODULE = "on" | ||
build: | ||
rm -rf bin/schemahero-integration-tests | ||
$(GO_BUILD) \ | ||
-ldflags "\ | ||
-X ${VERSION_PACKAGE}.version=${VERSION} \ | ||
-X ${VERSION_PACKAGE}.gitSHA=${GIT_SHA} \ | ||
-X ${VERSION_PACKAGE}.buildTime=${DATE}" \ | ||
-o bin/schemahero-integration-tests \ | ||
./cmd/integration | ||
@echo "built bin/schemahero-integration-tests" | ||
docker build -t $(IMAGE) -f ../Dockerfile.schemahero .. | ||
docker push $(IMAGE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
# Schemahero Integration Tests | ||
|
||
These tests verify SchemaHero by: | ||
|
||
1. Creating a database with an init script so that there are some predefined tables | ||
2. Applying a table.yaml | ||
3. Generating fixtures using schemahero | ||
4. Verifying that the generated fixtures are correct | ||
|
||
|
||
Ideally these tests should be executed from Go code for more reliability and easier to use. |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.