Commit Graph

334 Commits

Author SHA1 Message Date
Adrien Marquès 313b91bb7f
remove outdated tests 2020-03-08 16:26:56 +01:00
Adrien Marquès 5741ec597b
[breaking] do not return first element of 1-sized slices as it, return a slice
- it is more consistent and does not rely of a "hidden" assomption.
 - for consistency, it is also a better practice to always  the same type when waiting to receive a slice ; the 1 element case should not break anything
2020-03-08 16:26:56 +01:00
Adrien Marquès 7e7eb3ac29
fix returning first element of 1-sized slice instead of the slice 2020-03-08 16:26:56 +01:00
Adrien Marquès e132a5af42
test conversion from 1-sized slice to first element (bool vs json boolean primitive) 2020-03-08 16:26:56 +01:00
Adrien Marquès 41d166529c
test json invalid float primitives ; only valid when wrapped 2020-03-08 16:26:56 +01:00
Adrien Marquès 45675713e7
fix formatting type 2020-03-08 16:26:56 +01:00
Adrien Marquès 0395d763d6
test json invalid boolean primitives ; only valid when wrapped 2020-03-08 16:26:56 +01:00
Adrien Marquès 4d663fc56c
test string slice as string ; invalid json but valid when wrapped 2020-03-08 16:26:56 +01:00
Adrien Marquès 43fb3bb7c9
test uint builtin typecheck overflow values for []byte 2020-03-08 16:26:55 +01:00
Adrien Marquès 8fbe3dc178
test regex for builtin string typecheck 2020-03-08 16:26:55 +01:00
Adrien Marquès 98878eb127
test simple string parameter 2020-03-08 16:26:55 +01:00
Adrien Marquès fab09b2a5b
fix: mark parameter as parsed after successful parsing
- avoid parsing multiple times in a row ; it has no side-effect but is useless
 - actually does not cause any issue, but for consistency sake!
2020-03-08 16:26:55 +01:00
Adrien Marquès b890fa0ccc
return error when parsing parameters 2020-03-08 16:26:55 +01:00
Adrien Marquès edc49d9915
expand store.go coverage to 100% with a tricky test
- force http.Request.ParseForm to fail
2020-03-08 16:26:55 +01:00
Adrien Marquès f076f3a88a
replace bytes.NewBufferString() with strings.NewReader() 2020-03-08 16:26:55 +01:00
Adrien Marquès 727737ae67
test multipart body paramters 2020-03-08 16:26:55 +01:00
Adrien Marquès f2423bd71a
make internal/multipart use internal/cerr constant errors
- instead of defining its own
2020-03-08 16:26:55 +01:00
Adrien Marquès 638f5e44c8
test internal/config trick to have a 100% coverage (as conflict check is undeterministic, merge all conditions) 2020-03-08 16:26:55 +01:00
Adrien Marquès 228f5b9a02
test internal/config empty parameter rename should not rename 2020-03-08 16:26:55 +01:00
Adrien Marquès aba95d4163
remove dead code 2020-03-08 16:26:55 +01:00
Adrien Marquès e9c7160d2e
expand internal/config test coverage
- make parameter type "?" invalid as it marks it as optional only
- check optional vs. required parameters
- test subservice in method description error check
2020-03-08 16:26:55 +01:00
Adrien Marquès 61b58a9f98
add internal/config test for the Browse() method 2020-03-08 16:26:55 +01:00
Adrien Marquès dd0e321cbd
test internal/config parsing and illegal/missing fields 2020-03-08 16:26:55 +01:00
Adrien Marquès 5ac3b81f6d
parameter name conflict: on rename conflicting rename, return original name 2020-03-08 16:26:55 +01:00
Adrien Marquès 4accad7286
refactor internal/config
- create cerr (constant errors) with wrapped context (service name, method, parameter name)
- fix comments numbering
- remove duplicate check
2020-03-08 16:26:55 +01:00
Adrien Marquès dec7fd9a62
test internal/cerr package + add WrapString() to use a raw string 2020-03-08 16:26:55 +01:00
Adrien Marquès 5cdcfd21ca
fix typo 2020-03-08 16:26:55 +01:00
Adrien Marquès d44df7eee0
fix readme usage & changelog 2020-03-08 16:26:55 +01:00
Adrien Marquès 6bc8160f99
Prettify logs 2020-03-08 16:26:55 +01:00
Adrien Marquès d1d581bd75
Test json: add a check with invalid json (no parameter is parsed) 2020-03-08 16:26:55 +01:00
Adrien Marquès 5f1d76a0a8
Test json body parameters 2020-03-08 16:26:55 +01:00
Adrien Marquès ac7adcbd1f
Test with url encoded body parameters 2020-03-08 16:26:55 +01:00
Adrien Marquès 5897461323
Test store agains Query parameters 2020-03-08 16:26:55 +01:00
Adrien Marquès 44d19e8b65
Test store with uri arguments 2020-03-08 16:26:55 +01:00
Adrien Marquès 613233faef
Test empty store -> fix 2020-03-08 16:26:55 +01:00
Adrien Marquès c40fb03aa7
merge parseParameter 2020-03-08 16:26:55 +01:00
Adrien Marquès 1f9c3c02c1 Merge branch '0.2.0' of go/aicra into master
continuous-integration/drone/push Build is passing Details
2019-11-19 10:49:50 +00:00
Adrien Marquès 42b09c5c38 fix badge
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
2019-11-19 11:45:29 +01:00
Adrien Marquès 0348d33439 remove jenkins support
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
2019-11-18 16:18:42 +01:00
Adrien Marquès 82188560c6 add builtin.bool test + make other types that allow 'string' allow '[]byte' as well
continuous-integration/drone/push Build is passing Details
2019-11-18 16:17:02 +01:00
Adrien Marquès 1953abf722 add ci support
continuous-integration/drone/push Build is passing Details
2019-11-18 16:03:18 +01:00
Adrien Marquès acfbee3894 add startup logs
Log aicra configuration 'METHOD /PATH' when creating the instance
Log mapped handlers before starting listening

To know when we start listening (was transparently handled by http.ListenAndServer) ; added a wrapper around 'Server' (i.e. httpServer) that fulfills the http.Server interface
2019-09-26 19:03:37 +02:00
Adrien Marquès cabbc53a86 Merge branch '0.2.0' of gogs:go/aicra into 0.2.0 2019-09-26 18:09:52 +02:00
Adrien Marquès 4eb9f58074 Update readme 2019-09-26 14:28:11 +02:00
Adrien Marquès 54f2496943 feat: typechecks: tests for 'float64' 2019-05-06 19:26:36 +02:00
Adrien Marquès 4c5f13933c feat: typechecks: tests for 'uint' + add string repr for 'int' 2019-05-06 18:34:21 +02:00
Adrien Marquès 4e36adfcc9 readme: add ci badge 2019-05-06 18:34:21 +02:00
Adrien Marquès f53dfcbf62 ci: create jenkins file 2019-05-06 18:34:11 +02:00
Adrien Marquès be84c86172 fix: use t.Run in tests instead of for{} with i 2019-05-05 19:01:54 +02:00
Adrien Marquès 21f48a65ee feat: parallelize tests +ci 2019-05-05 19:01:54 +02:00