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

Add smoke tests #89

Merged
merged 5 commits into from
Nov 14, 2023
Merged

Add smoke tests #89

merged 5 commits into from
Nov 14, 2023

Conversation

ErikSchierboom
Copy link
Member

@ErikSchierboom ErikSchierboom commented Oct 31, 2023

  • Exclude more files from Docker build context
  • Add scripts to run tests
  • Add smoke tests to CI
  • Move input.ex files to lib directory for test data

I've tried to keep the existing structure as much the same as possible.

This helps prevent Docker layers from being invalidated needlessly.
The representer expects the source files to be in a `lib` directory.
Without this change, the Docker-based smoke test don't run.
@ErikSchierboom
Copy link
Member Author

@angelikatyborska Would you mind taking a look?

@angelikatyborska
Copy link
Member

I'm pretty busy in the next 7 days, maybe @jiegillet can review?

@jiegillet jiegillet self-assigned this Nov 10, 2023
Copy link
Contributor

@jiegillet jiegillet left a comment

Choose a reason for hiding this comment

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

Looks good, thank you for doing this, and sorry about the lib thing, I bet it took a while to figure out!

I left some minor requests.

echo "${test_dir_name}: comparing ${file} to ${expected_file}"

if ! diff "${test_dir_path}/${file}" "${test_dir_path}/${expected_file}"; then
exit_code=1
Copy link
Contributor

@jiegillet jiegillet Nov 10, 2023

Choose a reason for hiding this comment

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

Can we echo a something about the file being different here? Easier to make sense out of a failure. Same for the other check below.

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, the line above has:

echo "${test_dir_name}: comparing ${file} to ${expected_file}"

Wouldn't that be enough?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, because it won't exit here right? It only sets exit_code=1, so if something fails we won't know where that happened

Copy link
Member Author

Choose a reason for hiding this comment

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

This is an example of what the output looks like when there is a mismatch:

user_defined_structs: comparing representation.txt to expected_representation.ex
2c2
<   defstruct [:wheels, :doors, :color]
---
>   struct [:wheels, :doors, :color]

That's not enough you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, sorry I didn't realize we would get the output from the diff. Yes, thank you that's plenty.

.github/workflows/smoke_test.yml Show resolved Hide resolved
bin/run-tests.sh Show resolved Hide resolved
@ErikSchierboom ErikSchierboom merged commit d977be1 into main Nov 14, 2023
4 checks passed
@ErikSchierboom ErikSchierboom deleted the add-smoke-tests branch November 14, 2023 15:33
@ErikSchierboom
Copy link
Member Author

Thanks all!

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.

3 participants