Closed mikedavies-dev closed 3 years ago
It seems to be an issue with the configuration
and the read
function:
function read(file: string): Configuration {
const filePath = path.resolve(
__dirname,
"..",
"..",
"config",
`${file}.json`
);
return readJson(filePath);
}
That function resolves to src/config/default.json
instead of config/default.json
so it can't find the default or local config files. I'm guessing this could be a platform specific issue? I'm on MacOS. If I correct that function the tests connect to IB.
Another issue I'm seeing is with the Test reqPositions / cancelPositions
test. It appears to expect at least one open position to pass. Should these tests only be run when there are open positions in the paper trading account?
Thanks again.
The testing code still is pretty incomplete unfortunately and some also involve manual steps first (i.e. you must have a position to test reqPositions) . Only api-next tests run on CI right now as they only test the RxJS wrapper, but no actual tests against TWS are run (mainly because we don't have any spare paper accounts left that be used on CI). So if you want to add test code for reqHistoricalTicks, feel free to do so. There are no requirements on how it must look like, as we are still on "code gathering" phase. So better to have something, than nothing - we will build a full automated test-bed as soon as we have enough testing code and IB decides to sponsor some paper account for CI.
About the src-folder issue, I think it is a bug, but waiting on @Tsopic feedback.
Yeh, there seem to be at least 2 problems with configuration.ts
1) The location of the configuration.ts should be /src/common
and not buried deep somewhere.
2) envsToInclude
is missing most of the attributes, that we would want to include from env (IB_PORT, IB_HOST etc)
OK great, thanks for the feedback. I'll add a test or two for reqHistoricalTicks
. If you like i can take a look at the config issues as well while I'm there.
Hey, @ant-fx is this resolved? :)
Hey all,
I've noticed an issue with
reqHistoricalTicks
that I'd like to fix and add associated tests but I'm having getting the test suit up and running. I'm probably missing something in my setup.I'm running IB Gateway on port 4002 (paper trading account) and a lot of the API tests seem to work (i.e. I can see the test suite connecting to IB Gateway etc), but a lot of the tests timeout (test results below). The test suite is obviously connecting to IB Gateway in some tests because I can see active connections there and a lot of the API tests pass OK.
I've also tried running the docker image but that shows connection errors on 4002. I'm not sure if that needs to be running for the tests to work?
Any thoughts on what I might be missing in my dev setup?