refactor: replace integration test actors with dedicated actors - #895
Conversation
Swap legacy test actors for apify/normal-mode-test-actor and apify/example-mcp-server in the integration suite. Closes #783
1ed03b5 to
3abf276
Compare
There was a problem hiding this comment.
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-browserto the new dedicated test Actors. - Updated integration expectations to match the new test actor’s input/output shape (e.g.,
firstNumber/secondNumberfields andaddtool 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.
jirispilka
left a comment
There was a problem hiding this comment.
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.
| // 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 |
There was a problem hiding this comment.
I also wrote a review, you can re-enable
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Unfortunately, the tests still fail...
I will keep them commented out for now.
Co-authored-by: Jiří Spilka <jiri.spilka@apify.com>
MQ37
left a comment
There was a problem hiding this comment.
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
| // 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 |
There was a problem hiding this comment.
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.
|
@RobertCrupa @jirispilka two testing Actors deployed to staging |
removed all usage of actor name from the tests, we now only rely on the const. Also removed usage of temporary consts that just reference this const
jirispilka
left a comment
There was a problem hiding this comment.
Many thanks for changes!
Thanks 👍🏻
…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.
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>
Closes #783.
Integration tests previously depended on
apify/python-example,apify/actors-mcp-server, andapify/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 fixtureapify/example-mcp-server— MCP server Actor fixturesrc/const.tsRAG_WEB_BROWSERproduction 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.