Skip to content

ci(examples): test examples in CI #6813

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

Merged
merged 6 commits into from
Feb 3, 2024
Merged

ci(examples): test examples in CI #6813

merged 6 commits into from
Feb 3, 2024

Conversation

lachlancollins
Copy link
Member

@lachlancollins lachlancollins commented Feb 3, 2024

  • Removed --exclude=examples/** from test:pr and test:ci
  • Fixed up some examples (nextjs, svelte, solid)
  • Removed NX_CLOUD_AUTH_TOKEN (alias of NX_CLOUD_ACCESS_TOKEN)

Copy link

vercel bot commented Feb 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
query ⬜️ Ignored (Inspect) Visit Preview Feb 3, 2024 4:51am

Copy link

nx-cloud bot commented Feb 3, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 383b9ff. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

Copy link

codesandbox-ci bot commented Feb 3, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 383b9ff:

Sandbox Source
@tanstack/query-example-angular-basic Configuration
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (237e52c) 41.78% compared to head (383b9ff) 41.78%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6813   +/-   ##
=======================================
  Coverage   41.78%   41.78%           
=======================================
  Files         178      178           
  Lines        7017     7017           
  Branches     1421     1421           
=======================================
  Hits         2932     2932           
  Misses       3722     3722           
  Partials      363      363           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lachlancollins lachlancollins marked this pull request as ready for review February 3, 2024 04:53
@lachlancollins lachlancollins merged commit 2aeb0bf into main Feb 3, 2024
@lachlancollins lachlancollins deleted the ci-examples branch February 3, 2024 04:53
@TkDodo
Copy link
Collaborator

TkDodo commented Feb 3, 2024

The difference between examples and integrations was that examples depend on ^5.x so that they can run in codesandbox and stackblitz after we've released a new version, while the integrations depend on workspace:* so that they build with code on a PR before we have released it to find potential errors upfront. They were different use-cases and I think the split was good. I don't think it makes sense to spend CI time to "test" the same vite setup multiple times...

@lachlancollins
Copy link
Member Author

The difference between examples and integrations was that examples depend on ^5.x so that they can run in codesandbox and stackblitz after we've released a new version, while the integrations depend on workspace:* so that they build with code on a PR before we have released it to find potential errors upfront. They were different use-cases and I think the split was good. I don't think it makes sense to spend CI time to "test" the same vite setup multiple times...

I agree that it's annoying to have longer CI times, but I believe there is benefit to ensuring examples can build and pass type checks - it adds confidence that the examples work for users out-of-the-box. This PR found and fixed several places where our examples didn't work. Luckily with Nx caching, the added time isn't too bad when the cache hits.

I did forget that I had workspace:* in these apps, so this would need to change.

@TkDodo
Copy link
Collaborator

TkDodo commented Feb 3, 2024

I'm fine with type checking the examples but building integrations separately seems better. The integrations aren't examples. You can't run them, they don't do anything meaningful. If all examples in the example directory show up automatically on the docs page, this would be highly confusing.

It's also easier to get an overview of which frameworks in which version have coverage if those are in a separate directory

@lachlancollins
Copy link
Member Author

I'm fine with type checking the examples but building integrations separately seems better. The integrations aren't examples. You can't run them, they don't do anything meaningful. If all examples in the example directory show up automatically on the docs page, this would be highly confusing.

It's also easier to get an overview of which frameworks in which version have coverage if those are in a separate directory

That's a good point about being able to easily see the full list of covered frameworks. Since the vite and next builds were covered by examples directory, I thought it might be a small CI time gain to remove them.

R.e. the website: examples need to be added to the docs config to show up in the sidebar, so the integrations moved to examples don't show up.

@TkDodo
Copy link
Collaborator

TkDodo commented Feb 3, 2024

R.e. the website: examples need to be added to the docs config to show up in the sidebar, so the integrations moved to examples don't show up.

I'm aware, this was just a hypothetical scenario where all things in the examples dir show up automatically :)

the main points for separation are:

  • knowing which frameworks are covered
  • integrations depend on workspace:*, examples depend on ^5.x
    • examples are runnable outside of the monorepo because of that, integrations are not
  • type-checking examples is fine, building them is rather pointless

@lachlancollins
Copy link
Member Author

R.e. the website: examples need to be added to the docs config to show up in the sidebar, so the integrations moved to examples don't show up.

I'm aware, this was just a hypothetical scenario where all things in the examples dir show up automatically :)

the main points for separation are:

  • knowing which frameworks are covered

  • integrations depend on workspace:*, examples depend on ^5.x

    • examples are runnable outside of the monorepo because of that, integrations are not
  • type-checking examples is fine, building them is rather pointless

I've re-separated integrations in #6821 :) thanks for the feedback!

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