Skip to content

fix: run IML function tests against draft code, not published code#338

Merged
Kateřina Beňová (KatBen-Make) merged 2 commits into
masterfrom
fix/function-test-uses-draft-code
Apr 17, 2026
Merged

fix: run IML function tests against draft code, not published code#338
Kateřina Beňová (KatBen-Make) merged 2 commits into
masterfrom
fix/function-test-uses-draft-code

Conversation

@KatBen-Make
Copy link
Copy Markdown
Contributor

@KatBen-Make Kateřina Beňová (KatBen-Make) commented Mar 20, 2026

JIRA: https://make.atlassian.net/browse/IEN-14781
The function test runner was fetching all function code via the listing endpoint (/functions?code=true), which returns the published version. Now fetches each function's code via its direct endpoint (/functions/{name}/code) to get the latest draft, matching how test code is already fetched.

Summary:

  • Bug: Running IML function tests (F6 / "Run IML test") on a published app used the published (compiled) function code instead of the latest draft. Edits to code.js were not reflected when running tests until the app was re-published.
  • Root cause: The test runner fetched function code via the listing endpoint (GET /functions?code=true), which returns the published code property. The test code was correctly fetched via its direct endpoint.
  • Fix: Fetch each function's code individually via GET /functions/{name}/code (the direct draft endpoint), matching how test code is already fetched.

Test plan:

  • Open an already-published app with custom IML functions

  • Edit a function's code.js (e.g. change the return value)

  • Save the change (sends it to server as draft)

  • Run "Run IML test" (F6) — verify the test runs against the updated code, not the old published version

  • Verify tests still pass for unpublished (new) apps as before

Made-with: Cursor AI Opus 4.6

The function test runner was fetching all function code via the listing endpoint (/functions?code=true), which returns the published version. Now fetches each function's code via its direct endpoint (/functions/{name}/code) to get the latest draft, matching how test code is already fetched.

Made-with: Cursor
Copilot AI review requested due to automatic review settings March 20, 2026 16:13
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 20, 2026

Messages
Your PR title & description are valid

Generated 13. 4. 2026 19:20:20 GMT+2 for fd45600

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the IML function test runner to execute against the latest draft function code by fetching each function’s code from its direct endpoint instead of using the listing endpoint that returns the published version.

Changes:

  • Fetches function names via the listing endpoint and then fetches each function’s draft code via /functions/{name}/code.
  • Runs test-code fetch and function-list fetch in parallel.
  • Bumps package version to 2.5.1.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/commands/FunctionCommands.ts Switches from bulk “published code” retrieval to per-function “draft code” retrieval for test execution.
package.json Version bump to reflect the behavior change/fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/commands/FunctionCommands.ts
Comment thread src/commands/FunctionCommands.ts
Comment thread src/commands/FunctionCommands.ts
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

the changes LGTM, only one point regarding the version bump
see the comment below

Comment thread package.json Outdated
@KatBen-Make Kateřina Beňová (KatBen-Make) merged commit ba449d9 into master Apr 17, 2026
4 checks passed
@KatBen-Make Kateřina Beňová (KatBen-Make) deleted the fix/function-test-uses-draft-code branch April 17, 2026 17:15
@make-release make-release Bot mentioned this pull request Apr 8, 2026
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