good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
U
upper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
open
upper
Commits
2d800690
Commit
2d800690
authored
11 years ago
by
José Carlos Nieto
Browse files
Options
Downloads
Patches
Plain Diff
Adding -host flag for testing.
parent
51ffb79d
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.travis.yml
+3
-7
3 additions, 7 deletions
.travis.yml
db_test.go
+40
-25
40 additions, 25 deletions
db_test.go
with
43 additions
and
32 deletions
.travis.yml
+
3
−
7
View file @
2d800690
...
...
@@ -5,10 +5,6 @@ go:
-
1.2
-
1.2.1
addons
:
hosts
:
-
testserver.local
env
:
-
GOARCH=amd64
...
...
@@ -27,12 +23,12 @@ services:
before_script
:
-
cat mysql/_dumps/setup.sql | mysql -uroot
-
cat mysql/_dumps/structs.sql | mysql -uupperio -pupperio upperio_tests
-htestserver.local
-
cat mysql/_dumps/structs.sql | mysql -uupperio -pupperio upperio_tests
-
cat postgresql/_dumps/setup.sql | psql -U postgres
-
cat postgresql/_dumps/structs.sql | PGPASSWORD="upperio" psql -U upperio upperio_tests
-htestserver.local
-
cat postgresql/_dumps/structs.sql | PGPASSWORD="upperio" psql -U upperio upperio_tests
-
mongo upperio_tests --eval 'db.addUser("upperio", "upperio")'
# - cat ql/_dumps/structs.sql | $GOPATH/bin/ql -db ql/_dumps/test.db
script
:
-
go version
-
go test
-
go test
-host 127.0.0.1
This diff is collapsed.
Click to expand it.
db_test.go
+
40
−
25
View file @
2d800690
...
...
@@ -3,7 +3,9 @@ package db_test
import
(
"database/sql"
"errors"
"flag"
"labix.org/v2/mgo"
"log"
"reflect"
"testing"
"time"
...
...
@@ -27,31 +29,44 @@ var (
errDriverErr
=
errors
.
New
(
`Driver error`
)
)
var
settings
=
map
[
string
]
*
db
.
Settings
{
`sqlite`
:
&
db
.
Settings
{
Database
:
`upperio_tests.db`
,
},
`mongo`
:
&
db
.
Settings
{
Database
:
`upperio_tests`
,
Host
:
`testserver.local`
,
User
:
`upperio`
,
Password
:
`upperio`
,
},
`mysql`
:
&
db
.
Settings
{
Database
:
`upperio_tests`
,
Host
:
`testserver.local`
,
User
:
`upperio`
,
Password
:
`upperio`
,
},
`postgresql`
:
&
db
.
Settings
{
Database
:
`upperio_tests`
,
Host
:
`testserver.local`
,
User
:
`upperio`
,
Password
:
`upperio`
,
},
`ql`
:
&
db
.
Settings
{
Database
:
`file://upperio_test.ql`
,
},
var
settings
map
[
string
]
*
db
.
Settings
func
init
()
{
// Getting host from the environment.
host
:=
flag
.
String
(
"host"
,
"testserver.local"
,
"Testing server address."
)
flag
.
Parse
()
log
.
Printf
(
"Running tests against host %s.
\n
"
,
*
host
)
settings
=
map
[
string
]
*
db
.
Settings
{
`sqlite`
:
&
db
.
Settings
{
Database
:
`upperio_tests.db`
,
},
`mongo`
:
&
db
.
Settings
{
Database
:
`upperio_tests`
,
Host
:
*
host
,
User
:
`upperio`
,
Password
:
`upperio`
,
},
`mysql`
:
&
db
.
Settings
{
Database
:
`upperio_tests`
,
Host
:
*
host
,
User
:
`upperio`
,
Password
:
`upperio`
,
},
`postgresql`
:
&
db
.
Settings
{
Database
:
`upperio_tests`
,
Host
:
*
host
,
User
:
`upperio`
,
Password
:
`upperio`
,
},
`ql`
:
&
db
.
Settings
{
Database
:
`file://upperio_test.ql`
,
},
}
}
var
setupFn
=
map
[
string
]
func
(
driver
interface
{})
error
{
...
...
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