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
GitLab 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
8fc9d7c4
Commit
8fc9d7c4
authored
Mar 14, 2015
by
José Carlos Nieto
Browse files
Options
Downloads
Patches
Plain Diff
Removing flags and commenting out mysql and sqlite wrappers (which are not ready yet).
parent
23c5c597
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.travis.yml
+5
-2
5 additions, 2 deletions
.travis.yml
main_test.go
+23
-19
23 additions, 19 deletions
main_test.go
with
28 additions
and
21 deletions
.travis.yml
+
5
−
2
View file @
8fc9d7c4
language
:
go
language
:
go
go
:
go
:
# - 1.1 //
ql
fails to compile on go1.2
+
.
# - 1.1 //
Unsupported, QL
fails to compile on go
<
1.2.
-
1.2
-
1.2
-
1.2.1
-
1.2.1
-
1.2.2
-
1.2.2
...
@@ -10,9 +10,12 @@ go:
...
@@ -10,9 +10,12 @@ go:
-
1.3.2
-
1.3.2
-
1.3.3
-
1.3.3
-
1.4
-
1.4
-
1.4.1
-
1.4.2
env
:
env
:
-
GOARCH=amd64
-
GOARCH=amd64
-
TEST_HOST=127.0.0.1
install
:
install
:
-
sudo apt-get install bzr
-
sudo apt-get install bzr
...
@@ -38,4 +41,4 @@ before_script:
...
@@ -38,4 +41,4 @@ before_script:
script
:
script
:
-
go version
-
go version
-
go test
-host 127.0.0.1
-
go test
This diff is collapsed.
Click to expand it.
main_test.go
+
23
−
19
View file @
8fc9d7c4
...
@@ -24,8 +24,8 @@ package db_test
...
@@ -24,8 +24,8 @@ package db_test
import
(
import
(
"database/sql"
"database/sql"
"errors"
"errors"
"flag"
"log"
"log"
"os"
"reflect"
"reflect"
"strconv"
"strconv"
"testing"
"testing"
...
@@ -35,24 +35,24 @@ import (
...
@@ -35,24 +35,24 @@ import (
"gopkg.in/mgo.v2/bson"
"gopkg.in/mgo.v2/bson"
"upper.io/db"
"upper.io/db"
_
"upper.io/db/mongo"
_
"upper.io/db/mongo"
_
"upper.io/db/mysql"
//
_ "upper.io/db/mysql"
// Disabled temporarily.
_
"upper.io/db/postgresql"
_
"upper.io/db/postgresql"
// Temporary removing QL. It includes a _solaris.go file that produces
// Temporary removing QL. It includes a _solaris.go file that produces
// compile time errors on < go1.3.
// compile time errors on < go1.3.
// _ "upper.io/db/ql"
// _ "upper.io/db/ql"
_
"upper.io/db/sqlite"
//
_ "upper.io/db/sqlite"
// Disabled temporarily.
)
)
var
wrappers
=
[]
string
{
var
wrappers
=
[]
string
{
`sqlite`
,
//
`sqlite`,
`mysql`
,
//
`mysql`,
`postgresql`
,
`postgresql`
,
`mongo`
,
`mongo`
,
// `ql`,
// `ql`,
}
}
const
(
const
(
T
estAllWrappers
=
`all`
t
estAllWrappers
=
`all`
)
)
var
(
var
(
...
@@ -63,13 +63,19 @@ var settings map[string]*db.Settings
...
@@ -63,13 +63,19 @@ var settings map[string]*db.Settings
func
init
()
{
func
init
()
{
// Getting host from the environment.
// Getting settings from the environment.
host
:=
flag
.
String
(
"host"
,
"testserver.local"
,
"Testing server address."
)
wrapper
:=
flag
.
String
(
"wrapper"
,
"all"
,
"Wrappers to test."
)
flag
.
Parse
()
var
host
string
if
host
=
os
.
Getenv
(
"TEST_HOST"
);
host
==
""
{
host
=
"localhost"
}
var
wrapper
string
if
wrapper
=
os
.
Getenv
(
"TEST_WRAPPER"
);
wrapper
==
""
{
wrapper
=
testAllWrappers
}
log
.
Printf
(
"Running tests against host %s.
\n
"
,
*
host
)
log
.
Printf
(
"Running tests against host %s.
\n
"
,
host
)
settings
=
map
[
string
]
*
db
.
Settings
{
settings
=
map
[
string
]
*
db
.
Settings
{
`sqlite`
:
&
db
.
Settings
{
`sqlite`
:
&
db
.
Settings
{
...
@@ -77,19 +83,19 @@ func init() {
...
@@ -77,19 +83,19 @@ func init() {
},
},
`mongo`
:
&
db
.
Settings
{
`mongo`
:
&
db
.
Settings
{
Database
:
`upperio_tests`
,
Database
:
`upperio_tests`
,
Host
:
*
host
,
Host
:
host
,
User
:
`upperio`
,
User
:
`upperio`
,
Password
:
`upperio`
,
Password
:
`upperio`
,
},
},
`mysql`
:
&
db
.
Settings
{
`mysql`
:
&
db
.
Settings
{
Database
:
`upperio_tests`
,
Database
:
`upperio_tests`
,
Host
:
*
host
,
Host
:
host
,
User
:
`upperio`
,
User
:
`upperio`
,
Password
:
`upperio`
,
Password
:
`upperio`
,
},
},
`postgresql`
:
&
db
.
Settings
{
`postgresql`
:
&
db
.
Settings
{
Database
:
`upperio_tests`
,
Database
:
`upperio_tests`
,
Host
:
*
host
,
Host
:
host
,
User
:
`upperio`
,
User
:
`upperio`
,
Password
:
`upperio`
,
Password
:
`upperio`
,
},
},
...
@@ -98,9 +104,9 @@ func init() {
...
@@ -98,9 +104,9 @@ func init() {
},
},
}
}
if
*
wrapper
!=
T
estAllWrappers
{
if
wrapper
!=
t
estAllWrappers
{
wrappers
=
[]
string
{
*
wrapper
}
wrappers
=
[]
string
{
wrapper
}
log
.
Printf
(
"Testing wrapper %s."
,
*
wrapper
)
log
.
Printf
(
"Testing wrapper %s."
,
wrapper
)
}
}
}
}
...
@@ -1011,8 +1017,6 @@ func TestExplicitAndDefaultMapping(t *testing.T) {
...
@@ -1011,8 +1017,6 @@ func TestExplicitAndDefaultMapping(t *testing.T) {
defer
sess
.
Close
()
defer
sess
.
Close
()
col
,
err
=
sess
.
Collection
(
"Case_Test"
)
if
col
,
err
=
sess
.
Collection
(
"CaSe_TesT"
);
err
!=
nil
{
if
col
,
err
=
sess
.
Collection
(
"CaSe_TesT"
);
err
!=
nil
{
if
wrapper
==
`mongo`
&&
err
==
db
.
ErrCollectionDoesNotExist
{
if
wrapper
==
`mongo`
&&
err
==
db
.
ErrCollectionDoesNotExist
{
// Nothing, it's expected.
// Nothing, it's expected.
...
...
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