Git Product home page Git Product logo

Comments (12)

tinchodias avatar tinchodias commented on May 27, 2024

I realized there was a new version of @noha that fixed the problem and made me understand how were the tests actually working.

However, I contributed with a minor fix that was necessary to make MongoMockTests work well:

Name: Mongo-Core-MartinDias.51
Author: MartinDias
Time: 1 April 2016, 12:24:14.905261 am
UUID: ac639434-6771-4200-bcd4-addbc68b4cb4
Ancestors: Mongo-Core-NorbertHartl.50

Mongo default instance: use a class side instance variable (default), instead of a class variable (Default), so subclasses (e.g. MongoMock) can have their own default instance.

from voyage.

tinchodias avatar tinchodias commented on May 27, 2024

But this doesn't apply to Voyage until a new MongoTalk version is released... should i?

from voyage.

noha avatar noha commented on May 27, 2024

I'm not sure this change is a good one. Mongo is the central access point to the functionality. If there is the need for different implementation than Mongo it would be best to do: Mongo default: aMongoThing.
Otherwise everyone that needs to access e.g. MongoMock would need to reference MongoMock directly which does not look feasible. I looked into the MongoMockTest and the proper fix seems to have instead of

setUp
super setUp.
mongo := MongoMock default.

rather use

setUp
super setUp.
mongo := MongoMock new.

As long as we hold a reference to the mongo implementation there is no need to use the singleton. This way the tests are left alone even if the Mongo singleton points to a real database.

from voyage.

noha avatar noha commented on May 27, 2024

By using new the reset is unnecessary, too. I should have had that idea before

from voyage.

noha avatar noha commented on May 27, 2024

Name: Mongo-Tests-Core-NorbertHartl.6
Author: NorbertHartl
Time: 1 April 2016, 10:01:03.427534 am
UUID: d7868065-e04e-43b8-8545-e83031d165e1
Ancestors: Mongo-Tests-Core-NorbertHartl.5

Changed MongoMockTests to use MongoMock new instead of the singleton. This removes side effects and the need for resetting the MongoMock instance

from voyage.

tinchodias avatar tinchodias commented on May 27, 2024

Great! This makes total sense. Thanks. We can add it to Voyage travis tests after we release a new version.

However, I still have MongoTest>>testCollection and another in yellow. @noha did you said in other thread that you fixed them? maybe i missunderstood

from voyage.

noha avatar noha commented on May 27, 2024

In my image all tests are green. I have latest 5.0 image and vm

from voyage.

tinchodias avatar tinchodias commented on May 27, 2024

I realized my change to Mongo class wasn't reverted yet. I just reverted it:

Name: Mongo-Core-MartinDias.54
Author: MartinDias
Time: 6 May 2016, 12:24:03.404015 am
UUID: 9d5e9d08-91e5-4289-8f66-ce62334caa7e
Ancestors: Mongo-Core-HolgerHansPeterFreyther.53

Reverting this change I did in Mongo class:

Name: Mongo-Core-MartinDias.51
Author: MartinDias
Time: 1 April 2016, 12:24:14.905261 am
UUID: ac639434-6771-4200-bcd4-addbc68b4cb4
Ancestors: Mongo-Core-NorbertHartl.50

Mongo default instance: use a class side instance variable (default), instead of a class variable (Default), so subclasses (e.g. MongoMock) can have their own default instance.

from voyage.

tinchodias avatar tinchodias commented on May 27, 2024

Hi @noha

Still testGetNoneExistingCollection and testCollections are yellow here. The cause is the same in both cases: "database collections" is empty. In the shell, however, I see that test db has the expected collection...

  1. Both tests failing:

MongoTest run: #testCollections.
"--> 1 run, 0 passes, 0 skipped, 0 expected failures, 1 failures, 0 errors, 0 unexpected passes"

MongoTest run: #testGetNoneExistingCollection.
"--> 1 run, 0 passes, 0 skipped, 0 expected failures, 1 failures, 0 errors, 0 unexpected passes"

  1. I have latest versions:

(MCWorkingCopy allManagers
collect: [ :each | each versionInfo name ]
thenSelect: [ :each | each beginsWith: 'Mongo' ])
"--> #('Mongo-Queries-TorstenBergmann.1' 'Mongo-BSON-MartinDias.46' 'Mongo-Tests-Core-NorbertHartl.6' 'Mongo-Tests-Queries-TorstenBergmann.2' 'Mongo-Squeak-MartinDias.18' 'Mongo-Pharo-Tools-TorstenBergmann.7' 'Mongo-Tests-BSON-MartinDias.2' 'Mongo-Core-MartinDias.54')"

  1. I downloaded 50+vm of today:

Pharo5.0
Latest update: #50750

"'CoInterpreter VMMaker.oscog-eem.1855 uuid: d8e4a3c2-a3bf-4adc-b224-8012903a1ef4 May 4 2016
StackToRegisterMappingCogit VMMaker.oscog-eem.1855 uuid: d8e4a3c2-a3bf-4adc-b224-8012903a1ef4 May 4 2016
https://github.com/pharo-project/pharo-vm.git Commit: b8ec25a570d7539653e1d793e97609adb509aaed Date: 2016-05-04 11:14:22 +0200 By: Esteban Lorenzano [email protected] Jenkins build #589
'"

from voyage.

noha avatar noha commented on May 27, 2024

I downloaded 50+vm as well and in my case the tests are all green (well, sometimes testSelectAllJustAfterRemove fails). I took voyage from github, loaded development over the ConfigurationOf and then upgraded the mongo packages to match the versions you have. That is really strange.

from voyage.

noha avatar noha commented on May 27, 2024

@tinchodias Can you check that again? I never could reproduce your problems and all travis builds are green

from voyage.

tinchodias avatar tinchodias commented on May 27, 2024

@noha yes, this issue makes no sense now that mongo has travis build. We can close it now and I check later.

from voyage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.