Skip to content

refactor: replace integration test actors with dedicated actors - #895

Merged
RobertCrupa merged 12 commits into
masterfrom
refactor/replace-integration-test-actors
May 22, 2026
Merged

refactor: replace integration test actors with dedicated actors#895
RobertCrupa merged 12 commits into
masterfrom
refactor/replace-integration-test-actors

Conversation

@RobertCrupa

@RobertCrupa RobertCrupa commented May 21, 2026

Copy link
Copy Markdown
Contributor

Closes #783.

Integration tests previously depended on apify/python-example, apify/actors-mcp-server, and apify/rag-web-browser. The last one runs a real browser, making those tests slow and expensive.

Replaces them with dedicated test Actors:

  • apify/normal-mode-test-actor — standard Actor fixture
  • apify/example-mcp-server — MCP server Actor fixture

src/const.ts RAG_WEB_BROWSER production default is unchanged. Unit tests use Actor names as string fixtures only and were not touched.

Unfortunately, we had to introduce 2 Actor instead of 1 due to issues on the MCP server side, but a separate issue #857 was raised to fix those.

Swap legacy test actors for apify/normal-mode-test-actor and
apify/example-mcp-server in the integration suite.

Closes #783
@RobertCrupa
RobertCrupa force-pushed the refactor/replace-integration-test-actors branch from 1ed03b5 to 3abf276 Compare May 21, 2026 13:55
@github-actions github-actions Bot added t-ai Issues owned by the AI team. tested Temporary label used only programatically for some analytics. labels May 21, 2026
@RobertCrupa RobertCrupa changed the title Replace integration test actors refactor: replace integration test actors with dedicated actors May 21, 2026
@RobertCrupa
RobertCrupa marked this pull request as draft May 21, 2026 14:35
@RobertCrupa
RobertCrupa requested a review from Copilot May 21, 2026 15:14
@RobertCrupa
RobertCrupa marked this pull request as ready for review May 21, 2026 15:17
@RobertCrupa
RobertCrupa requested review from MQ37 and jirispilka May 21, 2026 15:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the integration test suite to stop relying on slow/expensive external Actors by switching test execution to dedicated fixture Actors (apify/normal-mode-test-actor and apify/example-mcp-server), while keeping the production default apify/rag-web-browser unchanged.

Changes:

  • Replaced most integration test Actor calls/fixtures from python-example / actors-mcp-server / rag-web-browser to the new dedicated test Actors.
  • Updated integration expectations to match the new test actor’s input/output shape (e.g., firstNumber/secondNumber fields and add tool for the MCP server fixture).
  • Updated test documentation and constants to reference the new fixture Actors.

Reviewed changes

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

File Description
tests/README.md Updates the documented list of required Actors for running integration tests.
tests/integration/suite.ts Refactors integration tests to use the new dedicated fixture Actors and updates assertions accordingly.
tests/integration/internals.test.ts Switches internals integration tests to use the new fixture Actor constant.
tests/const.ts Replaces old integration fixture Actor constants with the new dedicated fixture Actor constants.

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

Comment thread tests/README.md Outdated
Comment thread tests/integration/suite.ts
Comment thread tests/integration/suite.ts
Comment thread tests/integration/suite.ts

@jirispilka jirispilka left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks Robert! Nice

I left a couple of comments. Some of them were pre-existing but I believe they are worth to fix

Also, pre-existing, we are mixing: ACTOR_NORMAL_MODE_TEST and apify/normal-actor.... worth fixing as well.

Comment thread tests/README.md Outdated
// Should include actor card header and rating
expect(ratingText).toContain('Actor information');
expect(ratingText).toContain('Rating:');
// TODO: re-enable once apify/normal-mode-test-actor has reviews; Rating: is omitted when review count is 0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I also wrote a review, you can re-enable

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would honestly not test the rating as it is something less predictable - for example Robert rated the Actor days ago and the reting is still not there. We can instead write some unit test with Actor info fixture that tests the format function to return the Rating section in the output string.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, the tests still fail...

I will keep them commented out for now.

Comment thread tests/integration/suite.ts
Comment thread tests/integration/suite.ts Outdated
Comment thread tests/integration/suite.ts
Comment thread tests/integration/suite.ts Outdated
Comment thread tests/integration/suite.ts
Comment thread tests/integration/suite.ts Outdated
Comment thread tests/integration/suite.ts Outdated
RobertCrupa and others added 2 commits May 22, 2026 08:39
Co-authored-by: Jiří Spilka <jiri.spilka@apify.com>

@MQ37 MQ37 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Went through it and LGTM after you address all the comment from Jirka 👍 Good job!

We also need to deploy this Actor to staging - I will do that

Comment thread tests/integration/internals.test.ts Outdated
// Should include actor card header and rating
expect(ratingText).toContain('Actor information');
expect(ratingText).toContain('Rating:');
// TODO: re-enable once apify/normal-mode-test-actor has reviews; Rating: is omitted when review count is 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would honestly not test the rating as it is something less predictable - for example Robert rated the Actor days ago and the reting is still not there. We can instead write some unit test with Actor info fixture that tests the format function to return the Rating section in the output string.

Comment thread tests/integration/suite.ts
Comment thread tests/README.md Outdated
@MQ37

MQ37 commented May 22, 2026

Copy link
Copy Markdown
Contributor

@RobertCrupa @jirispilka two testing Actors deployed to staging

@jirispilka
jirispilka self-requested a review May 22, 2026 12:42

@jirispilka jirispilka left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Many thanks for changes!

Thanks 👍🏻

@RobertCrupa
RobertCrupa merged commit 712fb16 into master May 22, 2026
15 checks passed
@RobertCrupa
RobertCrupa deleted the refactor/replace-integration-test-actors branch May 22, 2026 12:53
MQ37 added a commit that referenced this pull request May 25, 2026
…fixture

#895 introduced dedicated test Actors (apify/normal-mode-test-actor,
apify/example-mcp-server). The latter is a standby MCP-server Actor by
definition, so swap it in for apify/rag-web-browser across all standby/
payment-mode tests that I added in this PR \u2014 keeps integration tests
on the dedicated fixtures rather than a production-default Actor.

The list-tools filter test is restructured: instead of asserting the
default standby Actor (RAG) is dropped from the default Actor list, it
now explicitly passes ACTOR_EXAMPLE_MCP_SERVER via the `actors` option
and asserts its proxied sub-tools (`*-add`) are filtered under payment
mode and present under standard auth.
jirispilka added a commit that referenced this pull request May 26, 2026
Closes #783.

Integration tests previously depended on `apify/python-example`,
`apify/actors-mcp-server`, and `apify/rag-web-browser`. The last one
runs a real browser, making those tests slow and expensive.

Replaces them with dedicated test Actors:
- `apify/normal-mode-test-actor` — standard Actor fixture
- `apify/example-mcp-server` — MCP server Actor fixture

`src/const.ts` `RAG_WEB_BROWSER` production default is unchanged. Unit
tests use Actor names as string fixtures only and were not touched.

Unfortunately, we had to introduce 2 Actor instead of 1 due to issues on
the MCP server side, but a separate issue #857 was raised to fix those.

---------

Co-authored-by: Jiří Spilka <jiri.spilka@apify.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-ai Issues owned by the AI team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace python-example, actors-mcp-server, and rag-web-browser with a new Actor for integration tests

5 participants