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

Specs Overhaul + build system via Earthly #815

Merged
merged 36 commits into from
Dec 21, 2023
Merged

Conversation

mdwagner
Copy link
Contributor

@mdwagner mdwagner commented Sep 21, 2023

Highlights

  • Introduced snapshots for testing if generated files and folders match their expectations (this includes content)
  • Now using Earthly for both CI and local development
  • Updated README with more current information
  • Removed script folder, as Earthly provides a nicer and more complete interface

Specs Overhaul

  • Testing is now split up into 3 parts: Unit, Integration, and End-to-end
  • Unit
    • Requirements: crystal
    • Tests that run crystal spec --tag "~integration"
    • All supported platforms should be able to run these
  • Integration
    • Requirements: crystal, lucky
    • Tests that run crystal spec --tag integration and need lucky in PATH
    • Only Linux runs these
  • End-to-end
    • Requirements: earthly, docker
    • Test suites that run inside docker containers using Earthly
    • Only Linux runs these
  • Security (also End-to-end)
    • Requirements: Bright secrets, earthly, docker
    • Similar to End-to-end test suite, but runs with BrightSec
    • Only Linux runs these

@mdwagner mdwagner self-assigned this Sep 21, 2023
Base automatically changed from feat/lucky-template-4 to main September 21, 2023 17:33
@mdwagner

This comment was marked as outdated.

@jwoertink jwoertink mentioned this pull request Oct 26, 2023
@mdwagner mdwagner added enhancement github_actions Pull requests that update Github_actions code labels Dec 13, 2023
fix: add expectation

feat: better error messages

feat: refactor spec_helper2

fix: formatting

fix: require ecr

feat: require crystal 1.6.2

feat: api_authentication generator specs

fix: move fixtures out of spec folder

fix: wrong version

fix: setup_tempfile macro

chore!: replace ameba with gh action

fix: conflicts

wip: specs rewrite

feat: wip refactor

feat: integration tasks spec

fix: task expectations

feat: wip

feat: wip

feat: wip docs

feat: earthfile built

chore: sec tester integration test
@mdwagner
Copy link
Contributor Author

mdwagner commented Dec 18, 2023

TODO: look at merging lucky_spec and task_spec

@mdwagner
Copy link
Contributor Author

mdwagner commented Dec 19, 2023

TODO: write guide for snapshots, earthly, testing, etc.

@mdwagner mdwagner linked an issue Dec 19, 2023 that may be closed by this pull request
@mdwagner mdwagner changed the title Better specs for LuckyTemplates Specs Overhaul + build system via Earthly Dec 21, 2023
@mdwagner mdwagner marked this pull request as ready for review December 21, 2023 03:50
Copy link
Member

@jwoertink jwoertink left a comment

Choose a reason for hiding this comment

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

It looks good from what I can tell. It might be a bit hard to really tell until we can get it in there and start using it.

One question I have is, with these files in the fixtures, is this where the templates all pull from, or are these duplicates of what goes in the templates just used for testing?

@mdwagner
Copy link
Contributor Author

They're duplicates in order to consistently know when things change. Which means, they are essentially the final versions of the files, but in a fossilized form. Also, they needed to be removed from the spec folder, because Crystal would try to include them, but they aren't meant to be used, just compared with.

@mdwagner
Copy link
Contributor Author

Consequently, because they are the final form, it's easier to see what it looks like from a user perspective.

@jwoertink
Copy link
Member

Sounds good. I saw we get this in and really start playing around with it to get a better feel for the flow.

@mdwagner mdwagner merged commit 762f2eb into main Dec 21, 2023
6 checks passed
@mdwagner mdwagner deleted the feat/lucky-template-specs branch December 21, 2023 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement github_actions Pull requests that update Github_actions code
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Replace the dom_xss Sec tests with xss
2 participants