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

Adding unit test for FeatureHistory #71

Merged
merged 4 commits into from
Aug 20, 2018

Conversation

gokulsfdc
Copy link
Contributor

  • Added unit tests for FeatureHistory class

@codecov
Copy link

codecov bot commented Aug 20, 2018

Codecov Report

Merging #71 into master will increase coverage by 0.23%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #71      +/-   ##
==========================================
+ Coverage   86.11%   86.34%   +0.23%     
==========================================
  Files         298      298              
  Lines        9305     9762     +457     
  Branches      303      531     +228     
==========================================
+ Hits         8013     8429     +416     
- Misses       1292     1333      +41
Impacted Files Coverage Δ
...om/salesforce/op/utils/spark/OpSparkListener.scala 98.7% <0%> (+1.29%) ⬆️
...a/org/apache/spark/sql/types/MetadataWrapper.scala 50% <0%> (+25%) ⬆️
.../main/scala/com/salesforce/op/FeatureHistory.scala 100% <0%> (+100%) ⬆️
.../scala/com/salesforce/op/cli/gen/ProblemKind.scala 100% <0%> (+100%) ⬆️
...src/main/scala/com/salesforce/op/cli/CliExec.scala 77.77% <0%> (+77.77%) ⬆️
...cala/com/salesforce/op/cli/gen/FileInProject.scala 100% <0%> (+100%) ⬆️
...in/scala/com/salesforce/op/cli/CliParameters.scala 80.95% <0%> (+80.95%) ⬆️
...a/com/salesforce/op/cli/gen/ProjectGenerator.scala 87.5% <0%> (+87.5%) ⬆️
...cala/com/salesforce/op/cli/gen/FileGenerator.scala 77.27% <0%> (+77.27%) ⬆️
...in/scala/com/salesforce/op/cli/gen/AvroField.scala 69.23% <0%> (+69.23%) ⬆️
... and 5 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 06ca844...9417a10. Read the comment docs.

Copy link
Collaborator

@tovbinm tovbinm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm! See some minor comments.

val stage1 = "stage1"
val stage2 = "stage2"

Spec(FeatureHistory.getClass) should "convert a feature history to metadata" in {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there is an actual class you can do: Spec[FeatureHistory] instead

}

it should "merge two featurehistory" in {
val featureHistory1 = FeatureHistory(originFeatures = Seq(feature1), stages = Seq(stage1))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to repeat featurehistory in the test name. Simply "merge two instances"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same in other tests @gokulsfdc

val featureHistory1 = FeatureHistory(originFeatures = Seq(feature1), stages = Seq(stage1))
val featureHistory2 = FeatureHistory(originFeatures = Seq(feature2), stages = Seq(stage2))

val map = Map[String, FeatureHistory](("1" -> featureHistory1), ("2" -> featureHistory2))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to specify map type.

@tovbinm
Copy link
Collaborator

tovbinm commented Aug 20, 2018

Please remove “featurehistory” from test names.

@tovbinm tovbinm merged commit 77a6adc into salesforce:master Aug 20, 2018
ericwayman pushed a commit that referenced this pull request Feb 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants