Skip to content

Commit 1ff72a1

Browse files
committed
Add travis
1 parent bd42c9b commit 1ff72a1

11 files changed

Lines changed: 101 additions & 107 deletions

.github/workflows/TagBot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: TagBot
2+
on:
3+
issue_comment:
4+
types:
5+
- created
6+
workflow_dispatch:
7+
jobs:
8+
TagBot:
9+
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: JuliaRegistries/TagBot@v1
13+
with:
14+
token: ${{ secrets.GITHUB_TOKEN }}
15+
ssh: ${{ secrets.DOCUMENTER_KEY }}
16+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
docs/build/
22
Manifest.toml
3+
test/debug.jl

.travis.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# https://docs.travis-ci.com/user/languages/julia
2+
language: julia
3+
os:
4+
- linux
5+
julia:
6+
- 1.6.1
7+
- nightly
8+
9+
matrix:
10+
allow_failures:
11+
- julia: nightly
12+
- julia: 1.6.1
13+
fast_finish: true
14+
notifications:
15+
email: false
16+
17+
after_success:
18+
# push coverage results to Codecov
19+
- julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
20+
# push coverage results to Coveralls
21+
- julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'

test/runtests-prerequisite.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using Pkg
2+
Pkg.activate(".")
3+
4+
using Revise
5+
6+
using Test
7+
using Random
8+
using Query
9+
using DataFrames
10+
using LibPQ
11+
12+
using PostgresORM
13+
using PostgresORM.PostgresORMUtil
14+
using PostgresORM.Tool

test/runtests-tool.jl

Lines changed: 0 additions & 59 deletions
This file was deleted.

test/runtests-util_get_ids_props_names.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
include("runtests-prerequisite.jl")
12

2-
mutable struct MyNewStruct <: PostgresORM.Model.IEntity
3+
mutable struct MyNewStruct <: PostgresORM.IEntity
34

45
actor_id::Union{Missing,Int32}
56
first_name::Union{Missing,String}

test/runtests-utils.jl

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
1-
using Pkg
2-
Pkg.activate(".")
3-
4-
using Revise
5-
6-
using Test
7-
using Random
8-
using Query
9-
10-
using PostgresORM.PostgresORMUtil
1+
include("runtests-prerequisite.jl")
112

123

134
@testset "Test utils.jl - function `string2enum()`" begin
@@ -23,12 +14,12 @@ end
2314

2415
@testset "Test utils.jl - function `dict2vectoroftuples()`" begin
2516
props = Dict(:a => 1, :b => missing, :c => "de", "d" => 9)
26-
dict2vectoroftuples(props)
17+
PostgresORMUtil.dict2vectoroftuples(props)
2718
end
2819

2920
@testset "Test utils.jl - function `vectoroftuples2dict()`" begin
3021
vectoroftuples = [(:a, 1),(:b, missing),(:c, "de"),("d", 9)]
31-
vectoroftuples2dict(vectoroftuples)
22+
PostgresORMUtil.vectoroftuples2dict(vectoroftuples)
3223
end
3324

3425
@testset "Test utils.jl - function `dictstringkeys2symbol()`" begin
@@ -68,7 +59,9 @@ end
6859

6960
@testset "Test utils.jl - function `dataframe2vector_of_namedtuples()`" begin
7061

71-
df = head(dataset("datasets","iris"))
62+
df = DataFrame(SepalLength = [5.1,3],
63+
SepalWidth = [3.5,4],
64+
Species = ["setosa","versicolor"])
7265

7366
df = @from i in df begin
7467
@select {i.SepalLength,i.SepalWidth,i.Species}
@@ -99,7 +92,6 @@ end
9992

10093
@testset "Test utils.jl - function `string2zoneddatetime`" begin
10194
PostgresORMUtil.string2zoneddatetime("2019-09-03T11:00:00.000Z")
102-
10395
end
10496

10597
@testset "Test utils.jl - function `postgresql_string_array_2_string_vector`" begin
@@ -115,17 +107,17 @@ end
115107
res = PostgresORMUtil.postgresql_string_array_2_string_vector(str)
116108
@test res == ["aa","bb","cc","dd"]
117109

110+
# This one fails
118111
str = "{\"bla bla\",bb,cc}"
119112
res = PostgresORMUtil.postgresql_string_array_2_string_vector(str)
120113
@test res == ["bla bla","bb","cc"]
121114

122-
occursin("\"","\"rfr")
123115
end
124116

125117

126118
@testset "Test utils.jl - function `getpropertiesvalues`" begin
127119

128-
mutable struct MyNewStruct <: PostgresORM.Model.IEntity
120+
mutable struct MyNewStruct <: PostgresORM.IEntity
129121

130122
actor_id::Union{Missing,Int32}
131123
first_name::Union{Missing,String}
@@ -151,7 +143,7 @@ end
151143

152144
@testset "Test utils.jl - function `setpropertiesvalues`" begin
153145

154-
mutable struct MyNewStruct <: PostgresORM.Model.IEntity
146+
mutable struct MyNewStruct <: PostgresORM.IEntity
155147

156148
actor_id::Union{Missing,Int32}
157149
first_name::Union{Missing,String}

test/runtests_prettify_id_values_as_str.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
include("runtests-prerequisite.jl")
2+
13
module Test_util_prettify_id_values_as_str
24

35
using PostgresORM
46

5-
mutable struct MyMovie <: PostgresORM.Model.IEntity
7+
mutable struct MyMovie <: PostgresORM.IEntity
68

79
title::Union{Missing,String}
810
year::Union{Missing,Int32}
@@ -20,7 +22,7 @@ module Test_util_prettify_id_values_as_str
2022
)
2123
end
2224

23-
mutable struct MyNewStruct <: PostgresORM.Model.IEntity
25+
mutable struct MyNewStruct <: PostgresORM.IEntity
2426

2527
actor_id::Union{Missing,Int32}
2628
first_name::Union{Missing,String}
@@ -81,7 +83,7 @@ module MyMovieORM
8183
end
8284

8385

84-
@testset "Test `util_prettify_id_values_as_str(values::Vector{<:Any})`"
86+
@testset "Test `util_prettify_id_values_as_str(values::Vector{<:Any})`" begin
8587

8688
mymovie =
8789
Test_util_prettify_id_values_as_str.MyMovie(title = "movie1",
@@ -93,6 +95,6 @@ end
9395
favorite_movie = mymovie)
9496

9597
PostgresORM.Controller.util_prettify_id_values_as_str(object)
96-
98+
9799

98100
end

test/runtests_util_convert_flatdictfromdb_to_structuredrenameddict.jl

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
mutable struct MyMovie <: PostgresORM.Model.IEntity
1+
include("runtests-prerequisite.jl")
2+
3+
mutable struct MyMovie <: PostgresORM.IEntity
24

35
title::Union{Missing,String}
46
year::Union{Missing,Int32}
@@ -14,14 +16,14 @@ mutable struct MyMovie <: PostgresORM.Model.IEntity
1416
end
1517

1618

17-
mutable struct MyNewStruct <: PostgresORM.Model.IEntity
19+
mutable struct MyGreatStruct <: PostgresORM.IEntity
1820

1921
id::Union{Missing,Int32}
2022
first_name::Union{Missing,String}
2123
favorite_movie::Union{Missing, MyMovie}
2224

23-
MyNewStruct(args::NamedTuple) = MyNewStruct(;args...)
24-
MyNewStruct(;
25+
MyGreatStruct(args::NamedTuple) = MyGreatStruct(;args...)
26+
MyGreatStruct(;
2527
id = missing,
2628
first_name = missing,
2729
favorite_movie = missing,
@@ -35,9 +37,9 @@ mutable struct MyNewStruct <: PostgresORM.Model.IEntity
3537

3638
end
3739

38-
module MyNewStructORM
39-
data_type = Main.MyNewStruct
40-
Main.PostgresORM.get_orm(x::Main.MyNewStruct) = return(MyNewStructORM)
40+
module MyGreatStructORM
41+
data_type = Main.MyGreatStruct
42+
Main.PostgresORM.get_orm(x::Main.MyGreatStruct) = return(MyGreatStructORM)
4143
get_table_name() = "public.my_new_struct"
4244
const columns_selection_and_mapping =
4345
Dict(
@@ -81,7 +83,7 @@ end
8183
:favorite_movie_title => "The Godfather",
8284
:favorite_movie_year => 1972)
8385

84-
86+
8587
PostgresORM.Controller.util_convert_flatdictfromdb_to_structuredrenameddict(flatdict,
86-
MyNewStruct)
88+
MyGreatStruct)
8789
end

test/runtests_util_get_ids_cols_names.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
include("runtests-prerequisite.jl")
2+
13
module Test_util_get_ids_cols_names
24

35
using PostgresORM
46

5-
mutable struct MySuperMovie <: PostgresORM.Model.IEntity
7+
mutable struct MySuperMovie <: PostgresORM.IEntity
68

79
title::Union{Missing,String}
810
year::Union{Missing,Int32}
@@ -17,7 +19,7 @@ module Test_util_get_ids_cols_names
1719
)
1820
end
1921

20-
mutable struct MyNewStruct <: PostgresORM.Model.IEntity
22+
mutable struct MyNewStruct <: PostgresORM.IEntity
2123

2224
actor_id::Union{Missing,Int32}
2325
first_name::Union{Missing,String}

0 commit comments

Comments
 (0)