Skip to content

Commit

Permalink
Add granite
Browse files Browse the repository at this point in the history
  • Loading branch information
bcardiff committed Jun 7, 2019
1 parent 700efa6 commit 47a049f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,10 @@ vagrant_fedora29_rpm: $(BINARIES)/linux.rpm services_on_host
vagrant destroy fedora29 -f

define prepare_services
sleep 5
sleep 7
docker-compose exec postgres createdb -U postgres crystal
docker-compose exec postgres createdb -U postgres test_app_development
docker-compose exec mysql mysql -uroot --execute="CREATE DATABASE test_granite"
endef

.PHONY: services_on_host
Expand Down
29 changes: 29 additions & 0 deletions bats/40-web-frameworks.bats
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,35 @@
popd
}

@test "amber granite specs" {
pushd $REPOS_DIR/amberframework/granite
shards
rm -rf ./lib/db && ln -s $REPOS_DIR/crystal-lang/crystal-db ./lib/db
rm -rf ./lib/mysql && ln -s $REPOS_DIR/crystal-lang/crystal-mysql ./lib/mysql
rm -rf ./lib/pg && ln -s $REPOS_DIR/will/crystal-pg ./lib/pg
rm -rf ./lib/sqlite3 && ln -s $REPOS_DIR/crystal-lang/crystal-sqlite3 ./lib/sqlite3

export PG_DATABASE_URL="postgres://postgres:@$POSTGRES_HOST:5432/postgres"
export MYSQL_DATABASE_URL="mysql://root@$MYSQL_HOST:3306/test_granite"
export SQLITE_DATABASE_URL="sqlite3:./test.db"

export CURRENT_ADAPTER="sqlite"
crystal spec $CRYSTAL_BUILD_OPTS

export CURRENT_ADAPTER="mysql"
crystal spec $CRYSTAL_BUILD_OPTS

export CURRENT_ADAPTER="pg"
crystal spec $CRYSTAL_BUILD_OPTS

unset PG_DATABASE_URL
unset MYSQL_DATABASE_URL
unset SQLITE_DATABASE_URL
unset CURRENT_ADAPTER

popd
}

@test "amber specs (build)" {
pushd $REPOS_DIR/amberframework/amber

Expand Down
1 change: 1 addition & 0 deletions scripts/10-clone-repos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ gh_clone luckyframework/lucky
gh_clone luckyframework/lucky_cli
gh_clone luckyframework/avram
gh_clone amberframework/amber
gh_clone amberframework/granite

0 comments on commit 47a049f

Please sign in to comment.