-
Notifications
You must be signed in to change notification settings - Fork 6
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
Rename and fix unit test target #47
Open
aronerben
wants to merge
4
commits into
master
Choose a base branch
from
bugfix/ci-tests
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
(executable | ||
(name test) | ||
(libraries letters alcotest alcotest-lwt lwt)) | ||
(libraries letters alcotest)) | ||
|
||
(rule | ||
(alias runtest) | ||
(action | ||
(run ./test.exe))) | ||
|
||
(rule | ||
(alias runtest-all) | ||
(action | ||
(run ./test.exe))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ let stream_to_string s = | |
go () | ||
;; | ||
|
||
let test_create_plain_text_email _ () = | ||
let test_create_plain_text_email _ = | ||
let recipients = [ To "[email protected]" ] in | ||
let subject = "Hello" in | ||
let body = Plain "Hello Dave" in | ||
|
@@ -23,10 +23,10 @@ let test_create_plain_text_email _ () = | |
| Error reason -> failwith reason | ||
in | ||
let message = stream_to_string stream in | ||
Lwt.return (print_string message) | ||
print_string message | ||
;; | ||
|
||
let test_create_html_email _ () = | ||
let test_create_html_email _ = | ||
let recipients = [ To "[email protected]" ] in | ||
let subject = "Hello" in | ||
let body = Html "<i>Hello Dave</i>" in | ||
|
@@ -37,10 +37,10 @@ let test_create_html_email _ () = | |
| Error reason -> failwith reason | ||
in | ||
let message = stream_to_string stream in | ||
Lwt.return (print_string message) | ||
print_string message | ||
;; | ||
|
||
let test_create_mixed_body_email _ () = | ||
let test_create_mixed_body_email _ = | ||
let recipients = [ To "[email protected]" ] in | ||
let subject = "Hello" in | ||
let body = Mixed ("Hello Dave", "<i>Hello Dave</i>", Some "blaablaa") in | ||
|
@@ -51,26 +51,22 @@ let test_create_mixed_body_email _ () = | |
| Error reason -> failwith reason | ||
in | ||
let message = stream_to_string stream in | ||
Lwt.return (print_string message) | ||
print_string message | ||
;; | ||
|
||
let () = | ||
Lwt_main.run | ||
(Alcotest_lwt.run | ||
"Email creation" | ||
[ ( "Generating body" | ||
, [ Alcotest_lwt.test_case | ||
"email with plain text body" | ||
`Quick | ||
test_create_plain_text_email | ||
; Alcotest_lwt.test_case | ||
"email with HTML text body" | ||
`Quick | ||
test_create_html_email | ||
; Alcotest_lwt.test_case | ||
"email with mixed plain text and HTML body" | ||
`Quick | ||
test_create_mixed_body_email | ||
] ) | ||
]) | ||
Alcotest.run | ||
"Email creation" | ||
[ ( "Generating body" | ||
, [ Alcotest.test_case | ||
"email with plain text body" | ||
`Quick | ||
test_create_plain_text_email | ||
; Alcotest.test_case "email with HTML text body" `Quick test_create_html_email | ||
; Alcotest.test_case | ||
"email with mixed plain text and HTML body" | ||
`Quick | ||
test_create_mixed_body_email | ||
] ) | ||
] | ||
;; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@mikonieminen @joseferben This line prevents alcotest from being installed, so I deleted it. Is there another way to circumvent that?
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.
I usually install in manually in a prior step.
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.
Where would you put it, do you have an example?
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.
Here we install some system deps before everything else: https://github.com/oxidizing/sihl/blob/master/.github/workflows/ci.yml#L43
And then we run
make deps
which install a bunch of dev dependencies.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.
Looking at the CI file, I think you can update to
uses: avsm/setup-ocaml@v2
and then omit those anyway.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.
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.
This does not seem to work, I think we still need to install dependencies somewhere? It's saying
ca-certs
is missing now