close
Skip to content

E2E Tests: Fix post types setup plugin#401

Open
ockham wants to merge 1 commit intotrunkfrom
fix/test-setup-post-types-plugin
Open

E2E Tests: Fix post types setup plugin#401
ockham wants to merge 1 commit intotrunkfrom
fix/test-setup-post-types-plugin

Conversation

@ockham
Copy link
Copy Markdown
Contributor

@ockham ockham commented Apr 2, 2026

While working on #397, I needed to change the add_new label on the custom post type (CPT) used for tests. However, this change didn't seem to take effect on the frontend.

This was due to the way the test CPT was registered: It was persisted to the DB, with another DB option set as a flag so the test wouldn't attempt to recreate the CPT and instead use the persisted one. As a result, any changes made programmatically to the CPT didn't take effect.

This PR changes the test setup so the CPT is created on the fly by the plugin (and not persisted to the DB).

Use of AI Tools

Claude Code was used to investigate the issue, and to write the fix.
(This is only fair: The issue was originally also produced by Claude Code.)

@ockham ockham self-assigned this Apr 2, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.21%. Comparing base (2875e2c) to head (c09ea34).

Additional details and impacted files
@@             Coverage Diff              @@
##              trunk     #401      +/-   ##
============================================
- Coverage     53.80%   53.21%   -0.59%     
  Complexity     4423     4423              
============================================
  Files           298      298              
  Lines         39468    39468              
============================================
- Hits          21235    21003     -232     
- Misses        18233    18465     +232     
Flag Coverage Δ
e2e-js 45.84% <ø> (-0.02%) ⬇️
e2e-php 41.20% <ø> (-1.24%) ⬇️
javascript 15.07% <ø> (ø)
phpunit 29.95% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ockham ockham mentioned this pull request Apr 2, 2026
17 tasks
@ockham ockham marked this pull request as ready for review April 2, 2026 21:28
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props bernhard-reiter.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

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.

1 participant