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

test: verify the generated image links are working #3127

Merged
merged 14 commits into from
Nov 9, 2024

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Sep 21, 2024

Fixes #3112

This PR adds an integration test for the image module/all methods that return a url that actually points to something to ensure the url is working as expected.

The integration tests are run once a week or on demand.

@ST-DDT ST-DDT added p: 1-normal Nothing urgent c: test m: image Something is referring to the image module labels Sep 21, 2024
@ST-DDT ST-DDT added this to the vAnytime milestone Sep 21, 2024
@ST-DDT ST-DDT self-assigned this Sep 21, 2024
Copy link

netlify bot commented Sep 21, 2024

Deploy Preview for fakerjs ready!

Name Link
🔨 Latest commit 4f96e95
🔍 Latest deploy log https://app.netlify.com/sites/fakerjs/deploys/672f395ad5c12c00080f173d
😎 Deploy Preview https://deploy-preview-3127.fakerjs.dev
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Sep 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.96%. Comparing base (0d85075) to head (4f96e95).
Report is 1 commits behind head on next.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #3127   +/-   ##
=======================================
  Coverage   99.96%   99.96%           
=======================================
  Files        2805     2805           
  Lines      217115   217115           
  Branches      976      979    +3     
=======================================
+ Hits       217044   217048    +4     
+ Misses         71       67    -4     

see 2 files with indirect coverage changes

@Shinigami92
Copy link
Member

The current provided solution feels like mixin unit with integration tests. IMO we should split them from each other. That way, because we rely here also on external sources, we could execute this in a scheduled workflow e.g. every week or so, so we also reduce the "ddos" outgoing from this repo.

@ST-DDT ST-DDT added the s: needs decision Needs team/maintainer decision label Oct 12, 2024
@ST-DDT
Copy link
Member Author

ST-DDT commented Oct 26, 2024

Team Decision

  • We will move these tests to integration-test/test/integration
  • We will run the integration test once a week

@ST-DDT ST-DDT added s: accepted Accepted feature / Confirmed bug and removed s: needs decision Needs team/maintainer decision labels Oct 26, 2024
@ST-DDT
Copy link
Member Author

ST-DDT commented Oct 29, 2024

@xDivisionByZerox Like this or should I really use a separate folder structure?

@xDivisionByZerox
Copy link
Member

@xDivisionByZerox Like this or should I really use a separate folder structure?

Thats how I do it in my projects, but I have my test files next to the actual implementation.

  • directory
    • file.ts
    • file.spec.ts (unit tests)
    • file.(integration|int|it)[.-]spec.ts
    • file.(e2e|cy)[.-]spec.ts

The structure feels natural to me.

Since the tests are already in a separate directory, one might suggest splitting integration and unit tests into two directories as well:

  • test
    • integration
    • file.(integration|int|it)?[.-]spec.ts
    • unit
    • file.spec.ts

On advantage would be that the test setup file might be more linear, since the file patter can be a diretory instead of a "crazy" pattern. Additionally, if integration tests do not have to follow the same structure like unit tests do, this might be a good approche as well.

@ST-DDT
Copy link
Member Author

ST-DDT commented Oct 31, 2024

There are currently too many open PRs to move the unit tests to a subfolder.
So I will only move the integration tests to a subfolder.

@ST-DDT ST-DDT marked this pull request as ready for review October 31, 2024 10:28
@ST-DDT ST-DDT requested a review from a team as a code owner October 31, 2024 10:28
@ST-DDT ST-DDT requested a review from a team October 31, 2024 10:28
@ST-DDT ST-DDT enabled auto-merge (squash) November 9, 2024 10:16
@ST-DDT ST-DDT merged commit 9ecf99b into next Nov 9, 2024
23 checks passed
@ST-DDT ST-DDT deleted the test/image/working-urls branch November 9, 2024 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: test m: image Something is referring to the image module p: 1-normal Nothing urgent s: accepted Accepted feature / Confirmed bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tests to methods that produce links to ensure they still work
4 participants