You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sources/platform/actors/development/automated_tests.md
+36-22Lines changed: 36 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,47 +1,55 @@
1
1
---
2
2
title: Automated tests
3
3
description: Learn how to automate ongoing testing and make sure your Actors perform over time. See code examples for configuring the Actor Testing Actor.
**Learn how to automate ongoing testing and make sure your Actors perform over time. See code examples for configuring the Actor Testing Actor.**
9
9
10
+
import Tabs from '@theme/Tabs';
11
+
import TabItem from '@theme/TabItem';
12
+
10
13
---
11
14
12
-
You should make sure your [Actors](../../index.mdx) are well-maintained. You might not always get feedback from your users. Therefore, it is crucial that you periodically check if your Actors work as expected. You can do this using our [monitoring suite](https://apify.com/apify/monitoring) or by setting up daily runs of the **Actor Testing** ([pocesar/actor-testing](https://apify.com/pocesar/actor-testing)) tool.
15
+
# Automated tests for Actors
13
16
14
-
The monitoring suite is sufficient for most scenarios and includes automated alerts. [See more information](https://apify.com/apify/monitoring) on the suite's page or [check out our tutorials](../../../monitoring/index.md).
17
+
Automated testing is crucial for maintaining the reliability and performance of your Actors over time. This guide will help you set up automated tests using the [Actor Testing Actor](https://apify.com/pocesar/actor-testing).
15
18
16
-
We recommend using the Actor Testing Actor for specific and advanced use cases. This guide will help you set it up.
19
+
## Set up automated tests
17
20
18
-
## Step-by-step guide
21
+
1. Prepare test tasks - Create 1–5 separate testing tasks for your Actor.
22
+
1. Configure Actor testing - Set up a task using the Actor Testing Actor.
23
+
1. Validate tests - Run the test task multiple times until all tests pass.
24
+
1. Schedule tests - Set up a recurring schedule for your tests.
25
+
1. Monitor results - Review and address any issues on a weekly basis.
19
26
20
-
1. Prepare 1–5 separate testing tasks for your Actor. ([See below](#set-up-tasks-you-will-test)).
21
-
2. Set up a task from the Actor Testing Actor. ([See below](#set-up-a-task-from-the-actor-testing-actor)).
22
-
3. Run the test task until all tests succeed (a few times).
23
-
4. Schedule the test to run at the frequency of your choice (recommended daily) and choose a communication channel receiving info about it ([Slack](https://apify.com/katerinahronik/slack-message) or [email](https://apify.com/apify/send-mail)).
24
-
5. Ensure you review and fix any issues on a weekly basis.
27
+
## Create test tasks
25
28
26
-
## Set up tasks you will test
29
+
Example of Actor testing tasks
27
30
28
-

31
+
When creating test tasks:
29
32
30
-
We also advise you to test your Actor's default run—one that uses the pre-filled inputs. It is often the first task your users run, and they may be put off if it doesn't work.
33
+
* Include a test for your Actor's default configuration
34
+
* Set a low `maxItem` value to conserve credits
35
+
* For large data tests, reduce test frequency to conserve credits
31
36
32
-
Set a low `maxItem` value for your testing tasks, so that you don't burn your credit. If you need to test your Actor with a large amount of data, set the scheduler to run less frequently.
37
+
## Configure the Actor Testing Actor
33
38
34
-
## Set up a task from the Actor Testing Actor
39
+
Follow the [setup guide](https://apify.com/pocesar/actor-testing) in the Actor's README.
35
40
36
-
You can [find the setup guide](https://apify.com/pocesar/actor-testing) in the Actor's README. We recommend testing for the following scenarios.
While you don't necessarily have to maintain your private Actors, public Actors require a higher degree of responsibility.
22
22
23
23
As the name implies, Public Actors are available to the public on [Apify Store](https://apify.com/store), which means that an unmaintained public Actor could negatively affect all the other users that depend on it for their own activities on the platform.
24
24
25
-
Public Actors are regularly submitted to [automated tests](./testing.mdx) to ensure they are functioning properly. Before making an Actor public, we recommend you reserve enough time to maintain the project (~2 hours weekly). This will ensure that your Actor maintains its long-term quality, improving your chances of successfully [monetizing your Actors](./monetize.mdx).
25
+
Public Actors are regularly submitted to [automated tests](/platform/actors/publishing/test) to ensure they are functioning properly. Before making an Actor public, we recommend you reserve enough time to maintain the project (~2 hours weekly). This will ensure that your Actor maintains its long-term quality, improving your chances of successfully [monetizing your Actors](./monetize.mdx).
@@ -34,7 +34,7 @@ If you plan on making a breaking change, please get in touch with us ahead of ti
34
34
35
35
Also, pay special attention to your Actor's documentation ([README](../../academy/get-most-of-actors/actor-readme)). It should be clear, detailed, and readable. Think of the users, who might not be developers, so try to use simple, easy-to-understand language and avoid technical jargon.
36
36
37
-
Ensure periodic testing. You can either do it yourself or [set up automatic testing](../development/deployment/automated_tests.md) / [monitoring](https://apify.com/apify/monitoring). Try to prevent your users from coming to you with the issues.
37
+
Ensure periodic testing. You can either do it yourself or [set up automatic testing](../development/automated_tests.md) / [monitoring](https://apify.com/apify/monitoring). Try to prevent your users from coming to you with the issues.
0 commit comments