Skip to content
This repository was archived by the owner on Dec 2, 2024. It is now read-only.

Add event channel to certification function#672

Merged
koslambrou merged 4 commits intoIntersectMBO:mainfrom
Quviq:certification-progress
Aug 25, 2022
Merged

Add event channel to certification function#672
koslambrou merged 4 commits intoIntersectMBO:mainfrom
Quviq:certification-progress

Conversation

@UlfNorell
Copy link
Contributor

You can pass an optional Control.Concurrent.Chan in the certification options to get events when tests pass or fail.

Pre-submit checklist:

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
    • Formatting, PNG optimization, etc. are updated
  • PR
    • Self-reviewed the diff
    • Useful pull request description
    • Reference the ADR in the PR and reference the PR in the ADR (if revelant)
    • Reviewer requested

@UlfNorell
Copy link
Contributor Author

@shlevy

Copy link
Collaborator

@shlevy shlevy left a comment

Choose a reason for hiding this comment

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

Mainly reviewed with respect to interface, let me know if you'd like me to review implementation as well.

| CrashToleranceTask
| WhitelistTask
| DLTestsTask
deriving (Eq, Show)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we get Enum (reflecting the actual run order) and Bounded? That way if more stages are added I can still give an overall X/Y number until I update my source.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also can we get something like renderCertificationTask :: CertificationTask -> Text/String that's nicer for formatting to the user, again in the case where this repo updates before I've had a chance to update source on my end?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If QC runs in more than one phase, can we get something like hasQCTests :: CertificationTask -> Bool?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think formatting for the end user is the responsibility of this code, and would be much better suited somewhere else.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@UlfNorell OK, that's fine

data CertificationOptions = CertificationOptions { certOptNumTests :: Int
, certOptOutput :: Bool }
data CertificationEvent = QuickCheckTestEvent (Maybe Bool) -- ^ Nothing if discarded, otherwise test result
| StartCertificationTask CertificationTask
Copy link
Collaborator

Choose a reason for hiding this comment

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

Rather than start events, would it be difficult to switch to end events with a result? Then we can infer start from when the previous stage ends (or when I first call certify)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What result are you looking for here? Would a boolean pass/fail be sufficient?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes that would be great!

Copy link
Contributor

Choose a reason for hiding this comment

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

Technically that information is already there in the QuickCheckTestEven constructor though?

Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose you don't get it for the unit tests though...

Copy link
Contributor

Choose a reason for hiding this comment

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

I propose start and end events to make the consumer less dependent on the internals of this function. I've implemented this and I'll push it soon...

@MaximilianAlgehed
Copy link
Contributor

@koslambrou could we get this merged?

@koslambrou koslambrou merged commit 4497333 into IntersectMBO:main Aug 25, 2022
@MaximilianAlgehed MaximilianAlgehed deleted the certification-progress branch January 4, 2023 09:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants