- 
                Notifications
    You must be signed in to change notification settings 
- Fork 12
feat: add zio spark test assertion system #307
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
base: master
Are you sure you want to change the base?
Conversation
| Why does it need a macro ? Spark produce values (seq(jsonoids)) that need ... Do you have an example for the syntax? | 
| 
 For the moment it generates something like this : 
 You need the macro to retrieve the value (Dataset(1, 2, 3)) and the assertion (isEmpty) from our custom assert function. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed, macro are not needed for this use case.
Are we adding them for something else later on? or related to quill / iskra?
I don't see the use case here, unless we are moving fast to explain advanced matchers :
df.expectAtLeast(
  row(__, 13), 
  row.as[Person].assertTrue(_.name.contains("toto") || _.age > 10)
)But that doesn't look like the actual direction.
@dylandoamaral could you explain why we need the macro for this PR ? Can the macro be reserved for another PR for advanced predicate checks?
I will take a look at zio-test to see if they use macro outside code Location or assertTrue.
| CrossVersion.partialVersion(scalaVersion.value).get._1 match { | ||
| case 3 => Seq.empty | ||
| case _ => Seq( | ||
| "org.scala-lang" % "scala-reflect" % scalaVersion.value % "provided", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pb, the user need the macro as a dependencie, as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it it the same expectation for zio: https://github.com/zio/zio/blob/series/2.x/project/BuildHelper.scala#L254.
| 
 I explained above why I use the macro, it is exactly the same code from zio assert. | 
…acros from zio.test
…d-zio-spark-test-assertion-system
🚧 On hold, it's not clear if this is useful as it is. It creates a lot of issue, given it doesn't really compose at the moment. 🚧
Here is the missing step for now :
assertSpark