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

feat(core): Add internal API for test definitions (no-changelog) #11591

Merged
merged 32 commits into from
Nov 12, 2024

Conversation

burivuhster
Copy link
Contributor

@burivuhster burivuhster commented Nov 6, 2024

Summary

This PR adds a set of internal API endpoints to work with Test Definitions.

Related Linear tickets, Github issues, and Community forum posts

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Nov 6, 2024
Copy link

codecov bot commented Nov 6, 2024

@burivuhster burivuhster force-pushed the ai-422-api-endpoint-evaluationtests-crud branch from 97404fd to 0b0cde4 Compare November 6, 2024 13:42
@burivuhster burivuhster marked this pull request as ready for review November 7, 2024 12:30
@burivuhster burivuhster requested a review from tomi November 7, 2024 12:30
@burivuhster burivuhster changed the title chore: Add internal API for test definitions (no-changelog) feat(core): Add internal API for test definitions (no-changelog) Nov 7, 2024
Copy link
Collaborator

@tomi tomi left a comment

Choose a reason for hiding this comment

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

Nice and easy to follow code. Also good tests 👏 Few comments but nothing major, nice work 🥇

// Fetch the first page
let resp = await authOwnerAgent.get('/evaluation/test-definitions?take=10');
expect(resp.statusCode).toBe(200);
expect(resp.body.data.count).toBe(15);
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should probably also test that the returned test definitions are also correct (ids should be enough)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made an attempt, but could not quickly come up with a reliable way to add tests in a specific order (the retrieval is ordered by createdAt field), so decided to postpone it

@burivuhster burivuhster requested a review from tomi November 11, 2024 14:50
Copy link
Collaborator

@tomi tomi left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Copy link
Contributor

✅ All Cypress E2E specs passed

Copy link

cypress bot commented Nov 11, 2024

n8n    Run #7820

Run Properties:  status check passed Passed #7820  •  git commit c8fe14885b: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 burivuhster 🗃️ e2e/*
Project n8n
Branch Review ai-422-api-endpoint-evaluationtests-crud
Run status status check passed Passed #7820
Run duration 04m 22s
Commit git commit c8fe14885b: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 burivuhster 🗃️ e2e/*
Committer Eugene Molodkin
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 462
View all changes introduced in this branch ↗︎

@burivuhster burivuhster merged commit e875bc5 into master Nov 12, 2024
39 of 40 checks passed
@burivuhster burivuhster deleted the ai-422-api-endpoint-evaluationtests-crud branch November 12, 2024 09:28
@janober
Copy link
Member

janober commented Nov 13, 2024

Got released with [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants