Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
goatherd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
arw
goatherd
Commits
497b3b57
Commit
497b3b57
authored
7 years ago
by
Lukas Braun
Browse files
Options
Downloads
Patches
Plain Diff
Only start Postgres for tests when requested
parent
b276bd54
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Makefile
+1
-1
1 addition, 1 deletion
Makefile
test_pg.sh
+15
-11
15 additions, 11 deletions
test_pg.sh
with
16 additions
and
12 deletions
Makefile
+
1
−
1
View file @
497b3b57
...
@@ -8,7 +8,7 @@ goatherd: goatherd.go
...
@@ -8,7 +8,7 @@ goatherd: goatherd.go
go build goatherd.go
go build goatherd.go
test_pg
:
goatherd.go goatherd_test.go test_pg.sh goatherd
test_pg
:
goatherd.go goatherd_test.go test_pg.sh goatherd
sh test_pg.sh
sh test_pg.sh
--start-pg
test_pam_goatherd
:
goatherd pam_goatherd.so test_pam_goatherd.sh
test_pam_goatherd
:
goatherd pam_goatherd.so test_pam_goatherd.sh
sh test_pam_goatherd.sh
sh test_pam_goatherd.sh
...
...
This diff is collapsed.
Click to expand it.
test_pg.sh
+
15
−
11
View file @
497b3b57
...
@@ -4,17 +4,21 @@ set -eu
...
@@ -4,17 +4,21 @@ set -eu
go
test
-c
-o
./goatherd.test &
go
test
-c
-o
./goatherd.test &
PGHOST
=
"
$PWD
/postgres_test"
if
[
"
${
1
:-
x
}
"
=
"--start-pg"
]
;
then
if
[
$#
-ge
1
]
;
then
PGHOST
=
"
$PWD
/postgres_test"
PGHOST
=
"
$(
realpath
--
"
$1
"
)
"
if
[
$#
-ge
1
]
;
then
shift
PGHOST
=
"
$(
realpath
--
"
$1
"
)
"
fi
shift
export
PGHOST
=
"
$PGHOST
"
fi
export
PGHOST
=
"
$PGHOST
"
.
./start_pg.sh
.
./start_pg.sh
trap
'start_pg_cleanup'
EXIT INT
trap
'start_pg_cleanup'
EXIT INT
createdb goatherd_test
createdb goatherd_test
export
DB_URL
=
"host=
$PGHOST
dbname=goatherd_test"
fi
echo
Waiting
for
compile to finish
echo
Waiting
for
compile to finish
wait
%1
wait
%1
...
@@ -22,13 +26,13 @@ wait %1
...
@@ -22,13 +26,13 @@ wait %1
echo
echo
echo
=====
Go Tests
=====
echo
=====
Go Tests
=====
DB_URL
=
"host=
$PGHOST
dbname=goatherd_test"
./goatherd.test
"
$@
"
./goatherd.test
"
$@
"
echo
=====
Command-Line Tests
=====
echo
=====
Command-Line Tests
=====
gh
()
{
gh
()
{
./goatherd
-config
"
$PWD
/pam_goatherd_test.conf"
-db-url
"
host=
$PGHOST
dbname=goatherd_test
"
"
$@
"
./goatherd
-config
"
$PWD
/pam_goatherd_test.conf"
-db-url
"
$DB_URL
"
"
$@
"
}
}
expecting
()
{
expecting
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment