Skip to content

Conversation

theobat
Copy link
Contributor

@theobat theobat commented Jun 22, 2024

Provides time indication for integration tests.
It's obviously not a very good benchmark, but it's still better than nothing for very big variations.

For posterity :
1191; 1237 - Ubuntu
980; 1018 - Macos latest
1578; 1515 - Windows latest

Copy link
Member

@mpilgrem mpilgrem left a comment

Choose a reason for hiding this comment

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

Subject to some minor observations, looks good to me.

$ Map.toList results

let timeDiff = diffUTCTime finalTime startTime
let timeDiffStr = formatTime defaultTimeLocale "%h:%m:%s" timeDiff
Copy link
Member

Choose a reason for hiding this comment

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

Did you mean "%h:%m:%s", or was your intention "%H:%M:%S". The former generates output like:

2024-06-22T16:28:37.8924296Z Integration tests ran in : 0:19:1191

because 1,191 seconds are equivalent to about 19 whole minutes and about 0 whole hours.

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 switched to "%H:%M:%S - total %s seconds"

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 misunderstood the docs)

res <- test next
loop (idx + 1) rest' (res <> accum)

Copy link
Member

Choose a reason for hiding this comment

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

Some redundant spaces have slipped in.

)
import qualified RIO.Set as Set
import qualified RIO.Text as T
import RIO.Time ( getCurrentTime, diffUTCTime, formatTime, defaultTimeLocale )
Copy link
Member

Choose a reason for hiding this comment

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

If you happen to make other revisions (see below), it would be good to list the imports in alphabetical order, for consistency.


let timeDiff = diffUTCTime finalTime startTime
let timeDiffStr = formatTime defaultTimeLocale "%h:%m:%s" timeDiff
logInfo (fromString ("Integration tests ran in : " ++ timeDiffStr))
Copy link
Member

Choose a reason for hiding this comment

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

The OverloadedStrings means that you do not have to apply the fromString to the literal:

logInfo $ "Integration tests ran in : " <> fromString timeDiffStr

logInfo "Failed tests:"
for_ failures $ \(x, ec) -> logInfo $ "- " <> display x <> " - " <> displayShow ec
exitFailure

Copy link
Member

Choose a reason for hiding this comment

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

Some redundant blank lines have slipped in.

@theobat
Copy link
Contributor Author

theobat commented Jun 22, 2024

@mpilgrem fixed the issues

@mpilgrem mpilgrem merged commit 88ac953 into commercialhaskell:master Jun 22, 2024
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.

2 participants