Makes it compile with nim 2.1.99 #fixes #36
Tried running this with nimble test got this message:
~/anonimongo/tests/utils_test.nim(78, 34) template/generic instantiation of `newMongo` from here
~/anonimongo/src/anonimongo/core/types.nim(306, 17) Error: ambiguous identifier: 'Uri' -- use one of the following:
uri.Uri: Uri
QKind.URI: QKind
I think it's because the uri variable defined above it make it ambiguous to use it as uri.Uri.
Tried running this with
nimble testgot this message:~/anonimongo/tests/utils_test.nim(78, 34) template/generic instantiation of `newMongo` from here ~/anonimongo/src/anonimongo/core/types.nim(306, 17) Error: ambiguous identifier: 'Uri' -- use one of the following: uri.Uri: Uri QKind.URI: QKindI think it's because the
urivariable defined above it make it ambiguous to use it asuri.Uri.
Yes. Thats why I moved it to the top in one of the changes. I missed that one because I couldnt get the test to work in local and it seems that the error you are seeing didnt trigger by my use case
It's solved by adjusting to uri.Uri so it won't be ambiguous anymore.
Also, at very least you should run nim r tests/test_bson_test.nim to check if it's breaking or not due to version upgrade.
This won't boot up mongod child process and simply tests for BSON module.
In case you want to test for most of db commands, you can set your config.nims like in this github action setting.
As long the standalone test is completed, whether success or failed, it will kill the booted mongod child process.
I will test soon, what is the status, was the Uri.uri adjusted? did it work?
No, not yet. The regressions are more than that.
I'm testing these changes... they seem to work fine on some of my applications. I'm still debugging other issues and going really slow, but these changes appear to work fine so far. Has anyone else done any testing for this branch?
Update when running testing:
/home/testing/shared/anonimongo/tests/test_bson_test.nim(24, 27) Error: type mismatch
Expression: newbson([("hello", toBson(100)), ("array world", bsonArray(["red", 50, 4.2])),
("hello world", toBson(isekai))])
[1] [("hello", toBson(100)), ("array world", bsonArray(["red", 50, 4.2])),
("hello world", toBson(isekai))]: array[0..2, (string, BsonBase)]
Expected one of (first mismatch at [position]):
[1] proc newBson(first: (string, BsonBase); table: varargs[(string, BsonBase)]): BsonDocument
[1] proc newBson(table = newOrderedTable[string, BsonBase]();
stream: Streamable = newStream(); filename = ""): BsonDocument
Tip: 55 messages have been suppressed, use --verbose to show them.
tools.nim(36) doCmd
Error: Execution failed with exit code 1
which I managed to change by explicitly adding table = newOrderedTable([...])
there are other issues I'm still testing, specifically regarding the Time type.
I'm testing these changes... they seem to work fine on some of my applications. I'm still debugging other issues and going really slow, but these changes appear to work fine so far. Has anyone else done any testing for this branch?
Update when running testing:
/home/testing/shared/anonimongo/tests/test_bson_test.nim(24, 27) Error: type mismatch Expression: newbson([("hello", toBson(100)), ("array world", bsonArray(["red", 50, 4.2])), ("hello world", toBson(isekai))]) [1] [("hello", toBson(100)), ("array world", bsonArray(["red", 50, 4.2])), ("hello world", toBson(isekai))]: array[0..2, (string, BsonBase)] Expected one of (first mismatch at [position]): [1] proc newBson(first: (string, BsonBase); table: varargs[(string, BsonBase)]): BsonDocument [1] proc newBson(table = newOrderedTable[string, BsonBase](); stream: Streamable = newStream(); filename = ""): BsonDocument Tip: 55 messages have been suppressed, use --verbose to show them. tools.nim(36) doCmd Error: Execution failed with exit code 1which I managed to change by explicitly adding table = newOrderedTable([...])
there are other issues I'm still testing, specifically regarding the
Timetype.
Update:
I've been trying to run the tests. there are multiple errors in the test_bson_test.nim. However, I've also been conducting tests on some of my applications as I slowly debug the multiple broken code from updating to 2.2.0. With this PR it seems to work fine.
Times and Ints seem to be the major issue... we may need to go through all of these issues to test the macros.