Add cockroach support and tests #896

Merged
lunny merged 27 commits from lunny/test_cockroach into master 2020-03-03 08:19:35 +00:00
Owner
No description provided.
Author
Owner

Should fix #802

Should fix #802
codecov-io commented 2018-04-16 07:25:35 +00:00 (Migrated from github.com)
Author
Owner

Codecov Report

Merging #896 into master will decrease coverage by 2.96%.
The diff coverage is 44%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #896      +/-   ##
==========================================
- Coverage   57.55%   54.58%   -2.97%     
==========================================
  Files          44       42       -2     
  Lines        7966     7661     -305     
==========================================
- Hits         4585     4182     -403     
- Misses       2818     2943     +125     
+ Partials      563      536      -27
Impacted Files Coverage Δ
engine.go 61.35% <42.85%> (-1.24%) ⬇️
dialect_postgres.go 73.5% <44.44%> (-2.46%) ⬇️
dialect_mssql.go 0% <0%> (-73.81%) ⬇️
session_exist.go 57.44% <0%> (-5.52%) ⬇️
rows.go 50.76% <0%> (-5.38%) ⬇️
session_update.go 52.22% <0%> (-4.39%) ⬇️
helpers.go 57.41% <0%> (-2.32%) ⬇️
tag.go 77.09% <0%> (-2.22%) ⬇️
xorm.go 64.61% <0%> (-2.06%) ⬇️
engine_cond.go 54.96% <0%> (-1.33%) ⬇️
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 57a7e44...4966715. Read the comment docs.

# [Codecov](https://codecov.io/gh/go-xorm/xorm/pull/896?src=pr&el=h1) Report > Merging [#896](https://codecov.io/gh/go-xorm/xorm/pull/896?src=pr&el=desc) into [master](https://codecov.io/gh/go-xorm/xorm/commit/57a7e4421e878f5c3da8cb68b5e2c9cc646bbf2d?src=pr&el=desc) will **decrease** coverage by `2.96%`. > The diff coverage is `44%`. [![Impacted file tree graph](https://codecov.io/gh/go-xorm/xorm/pull/896/graphs/tree.svg?width=650&token=yB5nO1krEe&height=150&src=pr)](https://codecov.io/gh/go-xorm/xorm/pull/896?src=pr&el=tree) ```diff @@ Coverage Diff @@ ## master #896 +/- ## ========================================== - Coverage 57.55% 54.58% -2.97% ========================================== Files 44 42 -2 Lines 7966 7661 -305 ========================================== - Hits 4585 4182 -403 - Misses 2818 2943 +125 + Partials 563 536 -27 ``` | [Impacted Files](https://codecov.io/gh/go-xorm/xorm/pull/896?src=pr&el=tree) | Coverage Δ | | |---|---|---| | [engine.go](https://codecov.io/gh/go-xorm/xorm/pull/896/diff?src=pr&el=tree#diff-ZW5naW5lLmdv) | `61.35% <42.85%> (-1.24%)` | :arrow_down: | | [dialect\_postgres.go](https://codecov.io/gh/go-xorm/xorm/pull/896/diff?src=pr&el=tree#diff-ZGlhbGVjdF9wb3N0Z3Jlcy5nbw==) | `73.5% <44.44%> (-2.46%)` | :arrow_down: | | [dialect\_mssql.go](https://codecov.io/gh/go-xorm/xorm/pull/896/diff?src=pr&el=tree#diff-ZGlhbGVjdF9tc3NxbC5nbw==) | `0% <0%> (-73.81%)` | :arrow_down: | | [session\_exist.go](https://codecov.io/gh/go-xorm/xorm/pull/896/diff?src=pr&el=tree#diff-c2Vzc2lvbl9leGlzdC5nbw==) | `57.44% <0%> (-5.52%)` | :arrow_down: | | [rows.go](https://codecov.io/gh/go-xorm/xorm/pull/896/diff?src=pr&el=tree#diff-cm93cy5nbw==) | `50.76% <0%> (-5.38%)` | :arrow_down: | | [session\_update.go](https://codecov.io/gh/go-xorm/xorm/pull/896/diff?src=pr&el=tree#diff-c2Vzc2lvbl91cGRhdGUuZ28=) | `52.22% <0%> (-4.39%)` | :arrow_down: | | [helpers.go](https://codecov.io/gh/go-xorm/xorm/pull/896/diff?src=pr&el=tree#diff-aGVscGVycy5nbw==) | `57.41% <0%> (-2.32%)` | :arrow_down: | | [tag.go](https://codecov.io/gh/go-xorm/xorm/pull/896/diff?src=pr&el=tree#diff-dGFnLmdv) | `77.09% <0%> (-2.22%)` | :arrow_down: | | [xorm.go](https://codecov.io/gh/go-xorm/xorm/pull/896/diff?src=pr&el=tree#diff-eG9ybS5nbw==) | `64.61% <0%> (-2.06%)` | :arrow_down: | | [engine\_cond.go](https://codecov.io/gh/go-xorm/xorm/pull/896/diff?src=pr&el=tree#diff-ZW5naW5lX2NvbmQuZ28=) | `54.96% <0%> (-1.33%)` | :arrow_down: | | ... and [19 more](https://codecov.io/gh/go-xorm/xorm/pull/896/diff?src=pr&el=tree-more) | | ------ [Continue to review full report at Codecov](https://codecov.io/gh/go-xorm/xorm/pull/896?src=pr&el=continue). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta) > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://codecov.io/gh/go-xorm/xorm/pull/896?src=pr&el=footer). Last update [57a7e44...4966715](https://codecov.io/gh/go-xorm/xorm/pull/896?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
Contributor

@lunny you can use the --background flag to run cockroachdb to run in the background

@lunny you can use the `--background` flag to run cockroachdb to run in the background
Contributor

@lunny it looks like a lot of failures from the tests come from the colType being STRING(255), per postgresql docs that is not an available column type.

The following table has the available column types for text/strings:

Name Description
character varying(n), varchar(n) variable-length with limit
character(n), char(n) fixed-length, blank padded
text variable unlimited length

Here is the link to the specific docs page that I am refering to: https://www.postgresql.org/docs/9.6/static/datatype-character.html

@lunny it looks like a lot of failures from the tests come from the colType being `STRING(255)`, per postgresql docs that is not an available column type. The following table has the available column types for text/strings: Name | Description -- | -- character varying(n), varchar(n) | variable-length with limit character(n), char(n) | fixed-length, blank padded text | variable unlimited length Here is the link to the specific docs page that I am refering to: https://www.postgresql.org/docs/9.6/static/datatype-character.html
vtolstov commented 2018-11-27 16:00:39 +00:00 (Migrated from github.com)
Author
Owner

gentle ping..

gentle ping..
Author
Owner

@vtolstov I will change this and test with the latest cockroach

@vtolstov I will change this and test with the latest cockroach
vtolstov commented 2018-12-23 10:46:31 +00:00 (Migrated from github.com)
Author
Owner

@lunny do you already have tests and all works fine?

@lunny do you already have tests and all works fine?
Author
Owner

Will continue the work on this PR.

Will continue the work on this PR.
lunny modified the milestone from 0.8 to 0.8.2 2019-10-21 03:49:16 +00:00
Author
Owner

a part of #802

a part of #802
First-time contributor

thanks! can you add cockroach server running in tests (i think that this is root case for message:

2019/11/13 09:18:53 db.Query: dial tcp: lookup cockroach on 127.0.0.11:53: no such host

)

thanks! can you add cockroach server running in tests (i think that this is root case for message: ``` 2019/11/13 09:18:53 db.Query: dial tcp: lookup cockroach on 127.0.0.11:53: no such host ``` )
Author
Owner

@vtolstov yeah. I have added it to drone but I missed start -insecure command and just pushed a new commit.

@vtolstov yeah. I have added it to drone but I missed `start -insecure` command and just pushed a new commit.
First-time contributor

@lunny as i see, you also need to add ip to /etc/hosts or change connection string

@lunny as i see, you also need to add ip to /etc/hosts or change connection string
First-time contributor

@lunny sorry, can you fix connection error?

@lunny sorry, can you fix connection error?
Author
Owner

@vtolstov I don't think we need add /etc/hosts since drone will do the name to internal ip? I'm investing why the cockroah docker is not work.

@vtolstov I don't think we need add /etc/hosts since drone will do the name to internal ip? I'm investing why the cockroah docker is not work.
techknowlogick reviewed 2019-11-16 06:17:26 +00:00
Dismissed
.drone.yml Outdated
@ -119,0 +123,4 @@
depends_on:
- build
commands:
- go test -v -race -db="postgres" -conn_str="postgres://postgres:@cockroach/xorm_test?sslmode=disable" -schema=xorm -coverprofile=coverage8-1.txt -covermode=atomic
Contributor

cockroach runs on different port

cockroach runs on different port
Contributor

https://drone.gitea.com/xorm/xorm/215/1/6 cockroach failed to start so DNS lookup failed

https://drone.gitea.com/xorm/xorm/215/1/6 cockroach failed to start so DNS lookup failed
First-time contributor

@lunny or @techknowlogick can you fix starting of cockroach db?

@lunny or @techknowlogick can you fix starting of cockroach db?
lunny modified the milestone from 0.8.2 to 1.1.1 2020-01-20 05:40:26 +00:00
Author
Owner

The problem is cockroach service run failed.

name: cockroach
  pull: default
  image: cockroachdb/cockroach:v19.2.4
  hostname: cockroach
  commands:
  - start --insecure
  when:
    event:
    - push
    - tag
    - pull_request
~~The problem is `cockroach` service run failed.~~ ```yml name: cockroach pull: default image: cockroachdb/cockroach:v19.2.4 hostname: cockroach commands: - start --insecure when: event: - push - tag - pull_request ```
Author
Owner

OK. Finally run cockroach on drone successfully! :) @techknowlogick @vtolstov

OK. Finally run cockroach on drone successfully! :) @techknowlogick @vtolstov
lunny modified the milestone from 1.1.1 to 1.0.0 2020-03-03 08:18:47 +00:00
lunny closed this pull request 2020-03-03 08:19:35 +00:00
First-time contributor

Wow! Many thanks! Last thing - when you want to tag new release of xorm?
P.S. Big thanks!

Wow! Many thanks! Last thing - when you want to tag new release of xorm? P.S. Big thanks!
First-time contributor

Wow! Many thanks! Last thing - when you want to tag new release of xorm?
P.S. Big thanks!

Wow! Many thanks! Last thing - when you want to tag new release of xorm? P.S. Big thanks!
Author
Owner

@vtolstov yes, I will tag 1.0.0 after left issues fixed on https://gitea.com/xorm/xorm/milestone/1242 .

@vtolstov yes, I will tag 1.0.0 after left issues fixed on https://gitea.com/xorm/xorm/milestone/1242 .
Sign in to join this conversation.
No description provided.