Skip to content

fix(import): make JSONImportPluginTests link#1545

Merged
datlechin merged 1 commit into
mainfrom
fix/json-import-plugin-test-link
Jun 1, 2026
Merged

fix(import): make JSONImportPluginTests link#1545
datlechin merged 1 commit into
mainfrom
fix/json-import-plugin-test-link

Conversation

@datlechin

Copy link
Copy Markdown
Member

Fixes the pre-existing macOS App Tests failure on main (introduced with #1536 and merged red).

Problem

JSONImportPluginTests did @testable import JSONImport and called the plugin's static methods. JSONImport builds as a loadable .tableplugin (wrapper.cfbundle), whose symbols a test target cannot link, so every JSONImportPlugin.* reference was an undefined symbol at link time and macOS App Tests failed. No other plugin test imports a plugin module this way.

Fix

  • Extract the pure parsing / row-extraction / field-inference logic into JSONImportParsing (a plain enum, no SwiftUI or bundle surface).
  • JSONImportPlugin delegates to it; behavior unchanged.
  • The test calls JSONImportParsing.* and drops @testable import JSONImport.
  • A membershipExceptions set compiles JSONImportParsing.swift into TableProTests too (same mechanism mcp-server uses to share TablePro/ sources), so the test links its own copy instead of the loadable bundle.

Verification

xcodebuild test -only-testing:TableProTests/JSONImportPluginTests passes locally (previously failed to link). All assertions unchanged.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

JSONImportParsing.swift,

P2 Badge Add the parsing file to the test target instead of excluding it

When building TableProTests, this synchronized-folder setting does not make JSONImportParsing.swift available to the test target: membershipExceptions are the files excluded from the target (the existing plugin entries use the same field to exclude Info.plist). Since the tests now reference JSONImportParsing directly and no longer import JSONImport, the test target will fail to compile with Cannot find 'JSONImportParsing' in scope unless this source file is actually added as a target member.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@datlechin datlechin merged commit 5fd2a27 into main Jun 1, 2026
4 checks passed
@datlechin datlechin deleted the fix/json-import-plugin-test-link branch June 1, 2026 16:10
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