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

Refactor journey tests #1140

Open
samayer12 opened this issue Sep 16, 2024 · 1 comment
Open

Refactor journey tests #1140

samayer12 opened this issue Sep 16, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation javascript Pull requests that update Javascript code tech-debt

Comments

@samayer12
Copy link
Collaborator

Describe what should be investigated or refactored

As part of #1020, I discovered that our journey tests are pretty brittle and follow some patterns that run contrary to how Jest tests are usually written. In general, tests rely on special hard-coded strings, are highly sequential, and spread implementation details across several files or different spots in the code.

While this means our Journey tests do provide confidence that Pepr works as intended, they're a poor example for additional contributors to model additional tests cases off of.

Links to any relevant code

Examine code in journey/, starting with entrypoint.test.ts.

Additional context

@samayer12 is splitting this issue off as a separate track of work from #1020, so there will be a branch created to reference existing refactor efforts, probably sometime before 19 Sep, that will be left as a comment on this issue.

@samayer12 samayer12 added documentation Improvements or additions to documentation javascript Pull requests that update Javascript code labels Sep 16, 2024
cmwylie19 added a commit that referenced this issue Sep 18, 2024
## Description

This PR is a version of #1116 without the overhaul to journey tests and
does not remove `TEST_MODE`.

## Related Issue

Fixes #1020 

Relates to #1140 

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging
- [x] Unit,
[Journey](https://github.com/defenseunicorns/pepr/tree/main/journey),
[E2E Tests](https://github.com/defenseunicorns/pepr-excellent-examples),
[docs](https://github.com/defenseunicorns/pepr/tree/main/docs),
[adr](https://github.com/defenseunicorns/pepr/tree/main/adr) added or
updated as needed
- [x] [Contributor Guide
Steps](https://docs.pepr.dev/main/contribute/#submitting-a-pull-request)
followed

---------

Co-authored-by: Case Wylie <[email protected]>
@samayer12
Copy link
Collaborator Author

samayer12 commented Sep 18, 2024

Reference branch 1140-journey-refactor as a starting point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation javascript Pull requests that update Javascript code tech-debt
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant