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 example of E2E testing #368

Merged
merged 1 commit into from
Oct 13, 2023
Merged

Conversation

lelgenio
Copy link
Contributor

Motivation

Discussion: #366

Checklist

  • added tests to verify new behavior
  • added an example template or updated an existing one
  • updated examples/README.md

@lelgenio lelgenio force-pushed the add-e2e-test-example branch 4 times, most recently from 9caf228 to 26731ca Compare October 11, 2023 04:29
wait-for-connection localhost:4444

export SSL_CERT_FILE="${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt"
${workspace}/bin/e2e_tests
Copy link
Contributor

@dpc dpc Oct 11, 2023

Choose a reason for hiding this comment

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

thought (non-blocking): Oh. Interesting. I think it works, and nothing wrong with it but generally build a whole workspace for testing and other things, and then run the e2e script.

The advantage is that the test scripts work all the same both from dev env (./script/run-some-test.sh) and CI.

IMO during daily work developers shouldn't need to touch Nix for anything but entering the dev shell.

In Flakebox I even added specialized commands to make it cleaner.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Certainly! I added a comment to highlight this.

@lelgenio
Copy link
Contributor Author

lelgenio commented Oct 12, 2023

I went ahead and added PostgreSQL to the example, just to hammer the point home that you can spin up anything together in the test. If it's too much, let me know!

@lelgenio lelgenio marked this pull request as ready for review October 12, 2023 02:34
@lelgenio
Copy link
Contributor Author

I didn't squash so it's easy to drop postgres if necessary

Copy link
Owner

@ipetkov ipetkov left a comment

Choose a reason for hiding this comment

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

Looking great, thanks for adding this @lelgenio !

I don't mind having postgres in there as long as it doesn't end up making the test suite run for too long (though we can always comment it out later if it does).

Few minor nit/cleanup comments and happy to merge afterwards!

examples/end-to-end-testing/flake.lock Outdated Show resolved Hide resolved
flake.nix Outdated Show resolved Hide resolved
examples/end-to-end-testing/flake.nix Outdated Show resolved Hide resolved
@lelgenio lelgenio requested a review from ipetkov October 12, 2023 16:26
@ipetkov ipetkov merged commit 88b2a5f into ipetkov:master Oct 13, 2023
8 checks passed
@ipetkov ipetkov mentioned this pull request Oct 13, 2023
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