Skip to content

Commit

Permalink
remove all use of connecting to postgres since the specs don't actual…
Browse files Browse the repository at this point in the history
…ly need it
  • Loading branch information
jwoertink committed Oct 20, 2024
1 parent e780de0 commit c850b3f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 27 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,10 @@ jobs:
continue-on-error: ${{ matrix.experimental }}
steps:
- uses: actions/checkout@v4
- name: Setup PostgreSQL v${{ matrix.postgres_version }}
uses: ikalnytskyi/action-setup-postgres@v6
with:
username: lucky
password: developer
port: 5432
postgres-version: ${{ matrix.postgres_version }}
- uses: crystal-lang/install-crystal@v1
with:
crystal: ${{matrix.crystal_version}}
- name: Install shards
run: shards install --skip-postinstall --skip-executables
- name: Run tests
run: crystal spec
env:
DATABASE_URL: postgres://lucky:developer@localhost:5432/authentic_test
14 changes: 2 additions & 12 deletions config.cr
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
database = "authentic_test"

class AppDatabase < Avram::Database
end

# The specs for this shard don't actually make DB queries
AppDatabase.configure do |settings|
if ENV["DATABASE_URL"]?
settings.credentials = Avram::Credentials.parse(ENV["DATABASE_URL"])
else
settings.credentials = Avram::Credentials.new(
database: database,
hostname: "db",
username: "lucky",
password: "developer"
)
end
settings.credentials = Avram::Credentials.parse("postgres://fake:password@localhost:5432/not_used")
end

Avram.configure do |settings|
Expand Down
6 changes: 0 additions & 6 deletions spec/spec_helper.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,3 @@ require "spec"
require "../src/authentic"
require "../config"
require "./support/**"

# Db::Setup.new(quiet: true).run_task

# Spec.before_each do
# AppDatabase.truncate
# end

0 comments on commit c850b3f

Please sign in to comment.