Skip to content

Conversation

@rainydio
Copy link
Contributor

@rainydio rainydio commented Mar 9, 2020

Summary

core-kernel package tests, fixes #3474. Couple of problems though:

MemoryQueue

There is unhandled promise rejection and there is no way to handle it or to report error to caller.

Then there is also problem with lastResults which is passed as argument to processFromIndex and at the same time kept as private field. It's mutable array and it's unclear why it's being passed around. Also there is no way to get those lastResults back. I could not find a single usage to determine the intent.

Another problem is with lastQueue field. It's set in couple of places but isn't ever read. As result calling resume several times will rerun same task again.

ClassManager

It has drivers field and functions to extend that. But that field isn't used during instantiation in createDriver function. I removed those. I could instantiate new instances on my own, but usual implementation through createDriverNameDriver is asynchronous. As for getDrivers method there is no way to return classes that might be created through createDriverNameDriver.

I guess it was refactored to support async creation and class instantiation wasn't removed completely:

import { Kernel } from "../contracts";
// import { DriverCannotBeResolved } from "../exceptions/container";
import { Identifiers, inject, injectable } from "../ioc";
import { pascalCase } from "../utils";

Checklist

  • WatchConfiguration bootstraper
  • IOC selectors
  • PluginConfiguration
  • PluginManifest
  • MemoryCacheStore
  • LocalConfigLoader
  • JoiValidator
  • Pipeline ServiceProvider
  • ClassManager
  • InstanceManager
  • Utils
  • NullCacheStore, NullEventDispatcher, NullFilesystem, NullLogger, NullPipeline, NullQueue, NullValidator
  • MemoryQueue

@rainydio rainydio changed the base branch from master to develop March 9, 2020 19:40
@codecov
Copy link

codecov bot commented Mar 9, 2020

Codecov Report

Merging #3593 into develop will increase coverage by 1.11%.
The diff coverage is 96.66%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3593      +/-   ##
===========================================
+ Coverage    75.07%   76.18%   +1.11%     
===========================================
  Files          448      448              
  Lines        10178    10184       +6     
  Branches      1315     1315              
===========================================
+ Hits          7641     7759     +118     
+ Misses        2515     2404     -111     
+ Partials        22       21       -1
Impacted Files Coverage Δ
packages/core-kernel/src/support/class-manager.ts 100% <ø> (+26.66%) ⬆️
packages/core-blockchain/src/blockchain.ts 0% <0%> (ø) ⬆️
...s/core-kernel/src/services/config/drivers/local.ts 100% <100%> (+7.4%) ⬆️
packages/core-kernel/src/utils/is-block-chained.ts 100% <100%> (+44.44%) ⬆️
...ges/core-kernel/src/services/cache/drivers/null.ts 100% <100%> (+100%) ⬆️
...ckages/core-kernel/src/support/instance-manager.ts 100% <100%> (+14.28%) ⬆️
...es/core-kernel/src/services/events/drivers/null.ts 100% <100%> (+75%) ⬆️
...s/core-kernel/src/services/cache/drivers/memory.ts 100% <0%> (+2.85%) ⬆️
...kages/core-kernel/src/utils/delegate-calculator.ts 100% <0%> (+6.25%) ⬆️
... and 17 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update babee6a...bce6adc. Read the comment docs.

@rainydio rainydio marked this pull request as ready for review March 10, 2020 12:59
@faustbrian faustbrian merged commit ae0ca12 into develop Mar 11, 2020
@ghost ghost deleted the test/core-kernel branch March 11, 2020 11:37
@ghost ghost removed the Status: Needs Review label Mar 11, 2020
@faustbrian
Copy link
Contributor

MemoryQueue will be sorted in another PR as discussed and ClassManager I'll have a look at when I am back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Increase test coverage of core-kernel to 100%

3 participants