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

chore: add flow._destroyPublishedAll helper for E2E tests #644

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

jessicamcinchak
Copy link
Member

@jessicamcinchak jessicamcinchak commented Feb 6, 2025

Now that flows are published on create, we need to add additional cleanup steps to our E2E API regression tests. There will also now be instances of more than one published flow associated with a flow during a single test, so it's ideal to have a destroyPublishedAll helper here.

Currently failing with error: Error: Foreign key violation. update or delete on table "users" violates foreign key constraint "published_flows_publisher_id_fkey" on table "published_flows"

{
  "response": {
    "errors": [{
      "message": "Foreign key violation. update or delete on table \"users\" violates foreign key constraint \"published_flows_publisher_id_fkey\" on table \"published_flows\"",
      "extensions": {
        "path":"$",
        "code":"constraint-violation"
      }
    }],
    "status":200,
    "headers":{}
  },
  "request": {
    "query": "mutation DestroyAllUsers {
          deleteUsers: delete_users(where: { id: { _is_null: false } }) {
            affectedRows: affected_rows
        }
      }
    "
  }
}

await client.request(gql`
mutation DestroyAllPublishedFlows {
deletePublishedFlows: delete_published_flows(
where: { id: { _is_null: false } }
Copy link
Contributor

Choose a reason for hiding this comment

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

First time looking into this _is_null:false condition, cool

Copy link
Contributor

@RODO94 RODO94 left a comment

Choose a reason for hiding this comment

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

Tested locally and all works for me

@jessicamcinchak jessicamcinchak merged commit 8f86565 into main Feb 6, 2025
3 checks passed
@jessicamcinchak jessicamcinchak deleted the jess/destroy-all-published-flows-helper branch February 6, 2025 16:56
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.

2 participants