Commit Graph

7 Commits

Author SHA1 Message Date
suranmiao
78382afb14 refactor: use reflect.TypeFor instead of reflect.TypeOf and improve related tests (#2101)
* refactor: using reflect.TypeFor

Signed-off-by: suranmiao <solsui@outlook.com>

* refactor: remove unused reflect.TypeFor calls and improve test assertions

* refactor: simplify TestSetup by removing reflect.TypeFor

* test: enhance test assertions and improve parallel execution in TestSetup

---------

Signed-off-by: suranmiao <solsui@outlook.com>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
2025-12-10 10:54:54 +11:00
Adrian Gallagher
19b8957f3f codebase: Replace !errors.Is(err, target) with testify (#1931)
* tests: Replace !errors.Is(err, target) with testify equivalents

* codebase: Manual !errors.Is(err, target) replacements

* typo: Replace errMisMatchedEvent with errMismatchedEvent

* tests: Enhance error messages for better output

* tests: Refactor error assertions in various test cases to use require and improve clarity

* misc linter: Fix assert should wording

* tests: Simplify assertions in TestCreateSignals for clarity and conciseness

* tests: Enhance assertion message in TestCreateSignals
2025-06-10 16:29:57 +10:00
Adrian Gallagher
a5b638bfb7 GHA: Add additional checks for common issues (#1922)
* GHA, tests: Add additional checks for common issues

These checks include:
- Ensuring that all testify funcs use their formatted variants (e.g., `assert.Equalf(t, expected, actual)` instead of `assert.Equal(t, expected, actual)`).
- Replacing `%s` with %q
- Enforcing consistent usage of should/must wording for testify assert/require messages

* Add support for checking backticked string format specifiers and fix issues

* tests: Fix error comparisons

* tests: Replace errors.Is(err, nil) usage with testify and automate check

* refactor: Rename ExtractPort to ExtractPortOrDefault

* tests: Replace assert with require for error handling in multiple test files

* tests: Replace assert with require for error handling and improve assertions in data tests

* tests: Fix typo in assertion message for StreamVol test

* OKX: Fix GetOpenInterestAndVolumeStrike test with instrument selection and improved assertions

* OKX: Revert intentional error check

* Improve error message for expiry time check in GetOpenInterestAndVolumeStrike test
2025-05-28 12:26:51 +10:00
Adrian Gallagher
225429bda6 CI/build: Update Go version, linters and fix minor issues (#1612)
* CI/build: Update Go version, linters and fix minor issues

* linters: Add intrange, copyloopvar, additional go vet linters to match gopls and fix issues
2024-08-16 17:41:11 +10:00
Adrian Gallagher
68588560e3 CI: Bump go version, linters and fix minor issues (#1010)
* Bump golang, golangci-lint versions and fix issues

* Add -fno-stack-protector

* Fix AppVeyor golangci-lint ver

* Nitters

* Nitters round 2
2022-08-17 11:37:22 +10:00
Adrian Gallagher
d9bcf8246f Bump golangci-lint, Docker and Go CI versions (#564)
* Bump golangci-lint and Go CI versions

* Bump golangci-lint version

* Address nitterinos
2020-09-24 09:52:37 +10:00
Andrew
70615279bd (GCTScript) Add technical analysis support via script bindings (#467)
* added mfi and example

* renamed to moving average

* converted to array return type and added obv and mfi

* started work on test coverage

* test coverage added for rsi & mfi

* test coverage added for all indicators removed go mod replace moved to append helper method

* moved all indicators to new appendTo and increased test coverage

* added additional test and bumped go-talib to latest commi

* go.mod update

* linter fixes

* go mod clean up

* small fixes

* reverted changes from previous attempt to rework as data is still incorrect now passing full OHLCV data back to script binding

* testing new structure of passing full ohlcv data

* started linking ohlcv to gctscript

* OHCLV link up completed reworking passing back to indicators started

* OHCLV link up completed reworking passing back to indicators started

* added test coverage for tofloat

* linter fixes (gofmt)

* removed unused value

* improved test coverage

* added correct detection for 1w added ParseInterval test coverage moved OHCLV string to const

* removed unused value

* first round of changes addressed

* all indicators have been split with packages named after each indicator and a new calculate() method added

* linters

* fixed tests

* added check to check ta is running in validator for uploading

* Added test data for OHLCV testing new indicator interface for wrapper

* typed const to float64

* reworked validator data to generate previous timestamps

* rewored macd to return slice of array

* adding bbands linking and example

* why didn't this pick it up before :D

* bumped up total number of modules for test

* moved parseIndicator to exchange added comments

* test coverage added for ParseMAType & ParseIndicatorSelector

* gofmt

* WIP changes

* updated tests for bbands  & obv bumped to latest go-talib

* move multiple use strong to const

* reverted rpc.pb.go to master

* added 4w option

* removed selector from obv as unneeded

* improved test coverage and reworked all indicator methods on how they pass errors back

* order incoming OHCLV data

* revert go.mod

* removed verbose toggles

* added spot asset type

* removed 4w as its unused/uncommon

* renamed

* reworked further tests

* converted all examples to use coinbasepro for consistency

* updated all date ranges to 2019 + 6 months

* backported binance OHLCV wrapper from #479

* removed o

* rounded numbers

* chnage requests addressed and attempt to fix MACD... today has been really unproctive code wise :D

* Migrated to gct-ta library

* Corrected test import

* wording changes on test

* removed TA lib from go.mod

* PR changes addressed

Removed parallel running from tests due to slight possibility in very extreme cases TestExecution might not be set to the expected value and will cause lower test coverage

* removed pkg folder

* bumped gct-ta version

* gct-ta version bump
2020-04-24 15:36:49 +10:00