Add cockroach support and tests #896

Merged
lunny merged 27 commits from lunny/test_cockroach into master 2 years ago
lunny commented 4 years ago
Owner
There is no content yet.
Poster
Owner

Should fix #802

Should fix #802
codecov-io commented 4 years ago (Migrated from github.com)
Poster
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).
Collaborator

@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
Collaborator

@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 3 years ago (Migrated from github.com)
Poster
Owner

gentle ping..

gentle ping..
Poster
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 3 years ago (Migrated from github.com)
Poster
Owner

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

@lunny do you already have tests and all works fine?
Poster
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 2 years ago
Poster
Owner

a part of #802

a part of #802

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 ``` )
Poster
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.

@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

@lunny sorry, can you fix connection error?

@lunny sorry, can you fix connection error?
Poster
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 2 years ago
Dismissed
.drone.yml Outdated
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
Collaborator

cockroach runs on different port

cockroach runs on different port
Collaborator

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

@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 2 years ago
Poster
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 ```
Poster
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 2 years ago
lunny closed this pull request 2 years ago

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!

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!
Poster
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 .
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
The pull request has been merged as b079bc05ff.
Sign in to join this conversation.
Loading…
There is no content yet.