Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

150 improve unit test coverage for mapless mongo core #160

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
ddc08fa
removes deprecated class
sebastianconcept Feb 27, 2024
67483ac
signaling MaplessClassNotFound when resolver can't find a class
sebastianconcept Feb 27, 2024
66b9951
adds coverage for translations:
sebastianconcept Feb 27, 2024
649aa4d
adds coverage to default action for MaplessError
sebastianconcept Feb 27, 2024
2ddfa7f
adds testPrintsWeightedNodeInAUsefulWay
sebastianconcept Feb 27, 2024
b461ffd
adds testChangeWeightedNodeWeight
sebastianconcept Feb 27, 2024
d0eafcf
fixes testMaplessErrorDefaultAction
sebastianconcept Feb 27, 2024
1af4808
CI adjust
sebastianconcept Feb 27, 2024
37f56e2
fixes unit-tests instructions for CI
sebastianconcept Feb 28, 2024
71978dc
baseline fix
sebastianconcept Feb 28, 2024
adb9398
adjusted baseline
sebastianconcept Feb 28, 2024
deaa714
adjust Mapless-Memory in the baseline
sebastianconcept Feb 28, 2024
ebcdf73
adjusts CI instructions
sebastianconcept Feb 28, 2024
7c431b4
adjusts baseline
sebastianconcept Feb 28, 2024
7da2af3
package rename
sebastianconcept Feb 28, 2024
05a77f3
renamed packages
sebastianconcept Feb 28, 2024
6c56ea8
added renamed package
sebastianconcept Feb 28, 2024
89e94ec
renamed package
sebastianconcept Feb 28, 2024
793674c
adjusted tests delays
sebastianconcept Feb 28, 2024
9816020
increased to 200ms
sebastianconcept Feb 28, 2024
b38a122
removes problematic package
sebastianconcept Feb 28, 2024
283b117
re-adds UnQLite
sebastianconcept Feb 28, 2024
9b39c51
increased delay for the CI
sebastianconcept Feb 28, 2024
6590b8a
added delay after unsubscribing in the test
sebastianconcept Feb 28, 2024
6d337ef
adjusted delays
sebastianconcept Feb 28, 2024
1df300b
adjusting delays
sebastianconcept Feb 28, 2024
04d9e4d
removed methods with inadequate abstraction and moved its implementat…
sebastianconcept Feb 28, 2024
2a069ff
adds testPoolBasics
sebastianconcept Feb 28, 2024
dcd1b81
adds assertion
sebastianconcept Feb 28, 2024
ff86fdb
renamed DummyPerson -> SamplePerson
sebastianconcept Feb 28, 2024
b94402a
moved test and removed repeated test
sebastianconcept Feb 28, 2024
9ac1ff8
add Codecov ignore files pattern
sebastianconcept Feb 28, 2024
a4e6718
renamed ignore type
sebastianconcept Feb 28, 2024
e63e99b
adds testConnectUsingMongoUrl and testGetMongoInfo
sebastianconcept Feb 28, 2024
949b222
add MaplessStandaloneMongoPoolTest
sebastianconcept Feb 28, 2024
6c2a7aa
adds some basic replica set tests
sebastianconcept Feb 28, 2024
5d99558
adds assertions
sebastianconcept Feb 28, 2024
36f009e
adds some replica set tests
sebastianconcept Mar 1, 2024
6c2ae8d
adds more MongoAPI tests
sebastianconcept Mar 1, 2024
0f30732
upgrades MongoDB
sebastianconcept Mar 1, 2024
75d3206
moves the mongo replica set tests to its own optional package so the …
sebastianconcept Mar 1, 2024
98ba549
moved misplaced replica set tests
sebastianconcept Mar 1, 2024
7ff5541
adds 3 tests
sebastianconcept Mar 1, 2024
17807ac
adds 16 tests
sebastianconcept Mar 2, 2024
9f29fac
adds 4 tests
sebastianconcept Mar 2, 2024
d001311
fixes codecov ignore
sebastianconcept Mar 2, 2024
544063a
adds 6 tests for the resolver
sebastianconcept Mar 2, 2024
4367848
ignore automated coverage of optional (manual so far) replica set tests
sebastianconcept Mar 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
smalltalk: [Pharo64-10]
smalltalk: [Pharo64-11]
redis-version: [7]
mongodb-version: ['4.4']
mongodb-version: ['7.0']
name: ${{ matrix.smalltalk }}
services:
postgres:
Expand Down
23 changes: 13 additions & 10 deletions .smalltalkci/.unit-tests.ston
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@ SmalltalkCISpec {
SCIMetacelloLoadSpec {
#baseline : 'Mapless',
#directory : '../src',
#load : [ 'Core',
'Memory',
'SQLite',
'Postgres',
'Mongo',
'Redis' ],
#load : [
'Core',
'Tests',
'Memory-Tests',
'SQLite-Tests',
'Postgres-Tests',
'Mongo-Tests',
'Redis-Tests',
'Redis-Observer-Tests' ],
#platforms : [ #pharo ]
}
],
#testing : {
#coverage : {
#packages : [
'Mapless-Base-Core',
'Mapless-Memory-Core',
'Mapless-Postgres-Core',
'Mapless-Mongo-Core',
'Mapless-Base',
'Mapless-Memory',
'Mapless-Postgres',
'Mapless-Mongo',
'Mapless-SQLite',
'Mapless-Redis',
'Mapless-Redis-Observer'
Expand Down
3 changes: 3 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ignore:
- "**/Manifest*.st"
- "**/*ReplicaSet*.st"
126 changes: 73 additions & 53 deletions src/BaselineOfMapless/BaselineOfMapless.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,43 @@ Class {
#category : #BaselineOfMapless
}

{ #category : #baseline }
{ #category : #baselines }
BaselineOfMapless >> baseline: spec [

<baseline>
spec
for: #common
do: [ self setUpBaseDependencies: spec.
self setUpPackages: spec.
spec
group: 'Core' with: #('Mapless-Base-Core');
group: 'Memory' with: #('Mapless-Memory-Tests');
group: 'Mongo' with: #('Mapless-Mongo-Tests');
group: 'Redis' with: #('Mapless-Redis-Tests');
group: 'Postgres' with: #('Mapless-Postgres-Tests');
group: 'SQLite' with: #('Mapless-SQLite-Tests');
group: 'UnQLite' with: #('Mapless-UnQLite-Tests');
group: 'Benchmark' with: #('Mapless-Benchmark-Core');
group: 'default' with: #('Memory' 'SQLite') ]
spec for: #common do: [
self setUpBaseDependencies: spec.
self setUpPackages: spec.
spec
group: 'Core' with: #( 'Mapless-Base' );
group: 'Tests' with: #( 'Mapless-Base' 'Mapless-Tests' );
group: 'Memory' with: #( 'Mapless-Memory' );
group: 'Memory-Tests'
with: #( 'Mapless-Memory' 'Mapless-Memory-Tests' );
group: 'Mongo' with: #( 'Mapless-Mongo' );
group: 'Mongo-Tests'
with: #( 'Mapless-Mongo' 'Mapless-Mongo-Tests' );
group: 'Mongo-ReplicaSet-Tests'
with: #( 'Mapless-Mongo-ReplicaSet-Tests' );
group: 'Redis' with: #( 'Mapless-Redis' );
group: 'Redis-Tests'
with: #( 'Mapless-Redis' 'Mapless-Redis-Tests' );
group: 'Redis-Observer-Tests'
with: #( 'Mapless-Redis-Observer' 'Mapless-Redis-Observer-Tests' );
group: 'Postgres' with: #( 'Mapless-Postgres' );
group: 'Postgres-Tests'
with: #( 'Mapless-Postgres' 'Mapless-Postgres-Tests' );
group: 'SQLite' with: #( 'Mapless-SQLite' );
group: 'SQLite-Tests'
with: #( 'Mapless-SQLite' 'Mapless-SQLite-Tests' );
group: 'UnQLite' with: #( 'Mapless-UnQLite' );
group: 'UnQLite-Tests'
with: #( 'Mapless-UnQLite' 'Mapless-UnQLite-Tests' );
group: 'Benchmark' with: #( 'Mapless-Benchmark-Core' );
group: 'default' with: #( 'Memory' 'SQLite' ) ]
]

{ #category : #baseline }
{ #category : #dependencies }
BaselineOfMapless >> setUpBaseDependencies: spec [
spec
baseline: 'JSON'
Expand All @@ -51,24 +68,24 @@ BaselineOfMapless >> setUpBaseDependencies: spec [
with: [ spec repository: 'github://svenvc/NeoJSON:v18/repository' ]
]

{ #category : #baseline }
{ #category : #dependencies }
BaselineOfMapless >> setUpBasePackages: spec [
spec
package: 'Mapless-Base-Core'
package: 'Mapless-Base'
with: [ spec requires: 'JSON' ].
spec
package: 'Mapless-Tests-Base'
with: [ spec requires: 'Mapless-Base-Core' ].
package: 'Mapless-Tests'
with: [ spec requires: 'Mapless-Base' ].
spec
package: 'Mapless-Memory-Core'
with: [ spec requires: #('Mapless-Base-Core') ].
package: 'Mapless-Memory'
with: [ spec requires: #('Mapless-Base') ].
spec
package: 'Mapless-Memory-Tests'
with: [ spec requires: #('Mapless-Memory-Core') ].
with: [ spec requires: #('Mapless-Memory') ].

]

{ #category : #baseline }
{ #category : #dependencies }
BaselineOfMapless >> setUpMongoDependencies: spec [

spec baseline: 'MongoTalk' with: [
Expand All @@ -77,14 +94,17 @@ BaselineOfMapless >> setUpMongoDependencies: spec [
loads: #( Client 'Mongo-DriverLegacy' ) ]
]

{ #category : #baseline }
{ #category : #dependencies }
BaselineOfMapless >> setUpMongoPackages: spec [
spec
package: 'Mapless-Mongo-Core'
with: [ spec requires: #('Mapless-Base-Core' 'MongoTalk') ].
package: 'Mapless-Mongo'
with: [ spec requires: #('Mapless-Base' 'MongoTalk') ].
spec
package: 'Mapless-Mongo-Tests'
with: [ spec requires: #('Mapless-Mongo-Core' 'Mapless-Tests-Base') ].
with: [ spec requires: #('Mapless-Mongo' 'Mapless-Tests') ].
spec
package: 'Mapless-Mongo-ReplicaSet-Tests'
with: [ spec requires: #('Mapless-Mongo-Tests') ].
spec
package: 'Mapless-Mongo-Log'
with: [ spec requires: #('Mapless-Mongo-Tests' 'NeoJSON') ].
Expand All @@ -93,7 +113,7 @@ BaselineOfMapless >> setUpMongoPackages: spec [
with: [ spec requires: 'Mapless-Mongo-Tests' ]
]

{ #category : #baseline }
{ #category : #dependencies }
BaselineOfMapless >> setUpPackages: spec [
self setUpBaseDependencies: spec.
self setUpBasePackages: spec.
Expand All @@ -114,22 +134,22 @@ BaselineOfMapless >> setUpPackages: spec [
self setUpUnQLitePackages: spec
]

{ #category : #baseline }
{ #category : #dependencies }
BaselineOfMapless >> setUpPostgresDependencies: spec [
spec baseline: 'P3' with: [ spec repository: 'github://svenvc/P3:v1.4' ]
]

{ #category : #baseline }
{ #category : #dependencies }
BaselineOfMapless >> setUpPostgresPackages: spec [
spec
package: 'Mapless-Postgres-Core'
with: [ spec requires: #('Mapless-Base-Core' 'P3') ].
package: 'Mapless-Postgres'
with: [ spec requires: #('Mapless-Base' 'P3') ].
spec
package: 'Mapless-Postgres-Tests'
with: [ spec requires: #('Mapless-Postgres-Core' 'Mapless-Tests-Base') ]
with: [ spec requires: #('Mapless-Postgres' 'Mapless-Tests') ]
]

{ #category : #baseline }
{ #category : #dependencies }
BaselineOfMapless >> setUpRedisDependencies: spec [
spec
baseline: 'RediStick'
Expand All @@ -138,27 +158,27 @@ BaselineOfMapless >> setUpRedisDependencies: spec [
loads: #('Core' 'ConnectionPool') ]
]

{ #category : #baseline }
{ #category : #dependencies }
BaselineOfMapless >> setUpRedisPackages: spec [

spec
package: 'Mapless-Redis'
with: [ spec requires: #( 'Mapless-Base-Core' 'RediStick' ) ].
with: [ spec requires: #( 'Mapless-Base' 'RediStick' ) ].

spec
package: 'Mapless-Redis-Observer'
with: [ spec requires: #( 'Mapless-Base-Core' ) ].
with: [ spec requires: #( 'Mapless-Redis' ) ].

spec package: 'Mapless-Redis-Observer-Tests' with: [
spec package: 'Mapless-Redis-Observer-Tests' with: [
spec requires: #( 'Mapless-Redis-Observer' 'Mapless-Redis-Tests'
'Mapless-Tests-Base' ) ].
'Mapless-Tests' ) ].

spec
package: 'Mapless-Redis-Tests'
with: [ spec requires: #( 'Mapless-Redis' 'Mapless-Tests-Base' ) ].
with: [ spec requires: #( 'Mapless-Redis' 'Mapless-Tests' ) ]
]

{ #category : #baseline }
{ #category : #dependencies }
BaselineOfMapless >> setUpSQLiteDependencies: spec [
spec
baseline: 'SQLite3'
Expand All @@ -167,31 +187,31 @@ BaselineOfMapless >> setUpSQLiteDependencies: spec [
loads: #('Core') ]
]

{ #category : #baseline }
{ #category : #dependencies }
BaselineOfMapless >> setUpSQLitePackages: spec [
spec
package: 'Mapless-SQLite-Core'
with: [ spec requires: #('Mapless-Base-Core' 'SQLite3') ].
package: 'Mapless-SQLite'
with: [ spec requires: #('Mapless-Base' 'SQLite3') ].
spec
package: 'Mapless-SQLite-Tests'
with: [ spec requires: #('Mapless-SQLite-Core' 'Mapless-Tests-Base') ]
with: [ spec requires: #('Mapless-SQLite' 'Mapless-Tests') ]
]

{ #category : #baseline }
{ #category : #dependencies }
BaselineOfMapless >> setUpUnQLiteDependencies: spec [
spec
baseline: 'PunQLite'
with: [ spec
repository: 'github://mumez/PunQLite:aab064c2e003ef18fcdf8dad2a139fa4b36b6ed6/repository';
repository: 'github://mumez/PunQLite:v2.0.1/repository';
loads: #('Core') ]
]

{ #category : #baseline }
{ #category : #dependencies }
BaselineOfMapless >> setUpUnQLitePackages: spec [
spec
package: 'Mapless-UnQLite-Core'
with: [ spec requires: #('Mapless-Base-Core' 'PunQLite') ].
package: 'Mapless-UnQLite'
with: [ spec requires: #('Mapless-Base' 'PunQLite') ].
spec
package: 'Mapless-UnQLite-Tests'
with: [ spec requires: #('Mapless-UnQLite-Core' 'Mapless-Tests-Base') ]
with: [ spec requires: #('Mapless-UnQLite' 'Mapless-Tests') ]
]
5 changes: 0 additions & 5 deletions src/Mapless-Base-Core/MaplessClassNotFound.class.st

This file was deleted.

5 changes: 0 additions & 5 deletions src/Mapless-Base-Core/MaplessTrivialResolver.class.st

This file was deleted.

1 change: 0 additions & 1 deletion src/Mapless-Base-Core/package.st

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #Dictionary }

{ #category : #'*Mapless-Base-Core' }
{ #category : #'*Mapless-Base' }
Dictionary >> asJsonObjectIn: aMaplessRepository [
"Answers a JSON object based on the contents of this dictionary."

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #JsonObject }

{ #category : #'*Mapless-Base-Core' }
{ #category : #'*Mapless-Base' }
JsonObject >> asJsonObjectIn: aMaplessRepository [
^ self
]
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
I store metadata for this package. These meta data are used by other tools such as the SmalllintManifestChecker and the critics Browser
"
Class {
#name : #ManifestMaplessBaseCore,
#name : #ManifestMaplessBase,
#superclass : #PackageManifest,
#category : #'Mapless-Base-Core-Manifest'
#category : #'Mapless-Base-Manifest'
}

{ #category : #'code-critics' }
ManifestMaplessBaseCore class >> ruleRBSentNotImplementedRuleV1FalsePositive [
ManifestMaplessBase class >> ruleRBSentNotImplementedRuleV1FalsePositive [
^ #(#(#(#RGPackageDefinition #(#'Mapless-Base-Core')) #'2021-09-18T15:55:40.299821-03:00') #(#(#RGClassDefinition #(#MaplessReference)) #'2022-03-13T14:06:38.150255-03:00') )
]
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#instVars : [
'data'
],
#category : #'Mapless-Base-Core-Models'
#category : #'Mapless-Base-Models'
}

{ #category : #accessing }
Expand Down Expand Up @@ -196,7 +196,7 @@

^ self == AnAbstractModelClass"

^ false
^ self == Mapless
]

{ #category : #testing }
Expand Down Expand Up @@ -244,7 +244,7 @@
Any subclass can override its own custom name.
The default plural name is the singular name
in lower case plus an 's' so beware of irregular nouns."

self deprecated: 'Application responsibility'.

Check warning on line 247 in src/Mapless-Base/Mapless.class.st

View check run for this annotation

Codecov / codecov/patch

src/Mapless-Base/Mapless.class.st#L247

Added line #L247 was not covered by tests
^ self singularName , 's'
]

Expand All @@ -253,7 +253,7 @@
"Answers the string expected in a nicely designed API.
Any subclass can override its own custom name.
The default name is the class name in lowercase."

self deprecated: 'Application responsibility'.

Check warning on line 256 in src/Mapless-Base/Mapless.class.st

View check run for this annotation

Codecov / codecov/patch

src/Mapless-Base/Mapless.class.st#L256

Added line #L256 was not covered by tests
^ self name asLowercase
]

Expand Down Expand Up @@ -665,10 +665,11 @@
]

{ #category : #actions }
Mapless >> sanitize: someFields [
"Removes someFields from the receiver."
Mapless >> sanitize: someProperties [
"Removes someProperties from the receiver."

someFields do: [ :key | self data removeKey: key ifAbsent: [ nil ] ]
someProperties do: [ :key |
self maplessData removeKey: key ifAbsent: [ nil ] ]
]

{ #category : #actions }
Expand Down
Loading
Loading