Skip to content

Commit

Permalink
docs(pricing): Docs updated with Pricing and Getting started
Browse files Browse the repository at this point in the history
  • Loading branch information
austyh authored and Malinskiy committed Jul 5, 2023
1 parent d71f724 commit 50d841b
Show file tree
Hide file tree
Showing 5 changed files with 186 additions and 167 deletions.
166 changes: 0 additions & 166 deletions docs/docs/cloud.md

This file was deleted.

145 changes: 145 additions & 0 deletions docs/docs/cloud/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
---
title: "Getting started"
---

## Prepare bundles for testing

### Android

Marathon Cloud supports tests written with **UIAutomator, Cucumber, Espresso, and [Kaspresso](https://github.com/KasperskyLab/Kaspresso) frameworks**.

Before initiating the testing process for your application, you’ll require two APK files: one for the application that’s being tested, and another for the tests themselves. Typically, `debug` variants are utilized for this purpose.

If the primary application resides under the `app/` subproject, you can execute the following command to build both the app and test APK:

```shell
# file structure
# |
# |--home
# |--john
# |--project <== you are here
# |--app <== it's your primary application
# ...
# |--build.gragle
# |--settings.gradle
./gradlew :app:assembleDebug :app:assembleDebugAndroidTest
```

Be sure to note the relative paths of the test APK and the app APK, as they will be required for running the tests. In the context of our example, involving the `app` project and the `debug` build, these files can be located at the following paths:

- App APK: `/home/john/project/app/build/outputs/apk/debug/app-debug.apk`
- Test APK: `/home/john/project/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk`

### iOS

Marathon Cloud supports tests written with **XCTest and XCUITest frameworks**.
Both the application and the tests must be built for the **ARM architecture**.

Before initiating the testing process for your iOS application, you’ll need to create two `.app` bundles: one for the application that's being tested, and another for the tests themselves. Typically, `debug` variants are utilized for this purpose.

Let's say our project is called "Sample". The code snippet below shows how to build the .app bundle:

```shell
# file structure
# |
# |--home
# |--john
# |--sample <== you are here
# |--sample <== it's your application
# ...
# |--sample.xcodeproj

xcodebuild build-for-testing \
-project sample.xcodeproj \
-scheme sample \
-destination 'platform=iOS Simulator,name=iPhone 14,OS=16.1' \
-derivedDataPath ./build
```

Note the relative paths of applications, as they will be required for running the tests. In the context of our example and `debug` build, these files can be located at the following paths:

- Application: `/home/john/sample/build/Build/Products/Debug-iphonesimulator/sample.app`
- Test APK: `/home/john/sample/build/Build/Products/Debug-iphonesimulator/sampleUITests-Runner.app`

One important thing to note is that `*.app` files are actually folders in disguise. To transfer them, it's necessary to convert these bundles into `.ipa` format or standard `zip` archives:
```shell
# file structure
# |
# |--home
# |--john
# |--sample <== you are here
# |--build <== derivedData folder
# |--sample <== it's your application
# ...
# |--sample.xcodeproj
cd build/Build/Products/Debug-iphonesimulator
# convert to zip archive in this example
zip -r sample.zip sample.app
zip -r sampleUITests-Runner.zip sampleUITests-runner.app
```

Further, we will use these files:

- Application: `/home/john/sample/build/Build/Products/Debug-iphonesimulator/sample.zip`
- Test APK: `/home/john/sample/build/Build/Products/Debug-iphonesimulator/sampleUITests-Runner.zip`


## Samples (optional)

To showcase the advantages of Marathon Cloud compared to other solutions, we've prepared a sample app with 300 tests, of which 15% are flaky. During the initial run, our platform will gather information about the tests. During the second run, it will optimize it to fit within 15 minutes.
<Tabs>
<TabItem value="iOS" label="iOS">
```shell
# Download the prebuilt iOS Application
curl https://cloud.marathonlabs.io/samples/ios/sample.zip -o sample.zip
# Download the prebuilt iOS Test Application
curl https://cloud.marathonlabs.io/samples/ios/sampleUITests-Runner.zip -o sampleUITests-Runner.zip
```
</TabItem>
<TabItem value="Android" label="Android">
```shell
# Download the prebuilt Android Application
curl https://cloud.marathonlabs.io/samples/android/app.apk -o app.apk
# Download the prebuilt Android Test Application
curl https://cloud.marathonlabs.io/samples/android/appTest.apk -o appTest.apk
```
</TabItem>
</Tabs>
## Execution
Now you can start running your tests. Use the following command to execute the CLI with the necessary parameters:
<Tabs>
<TabItem value="iOS" label="iOS">
```shell
marathon-cloud \
-api-key api_key \
-app sample.zip \
-testapp sampleUITests-Runner.zip \
-platform iOS
```
</TabItem>
<TabItem value="Android" label="Android">
```shell
marathon-cloud \
-api-key api_key \
-app app.apk \
-testapk appTest.apk \
-platform Android
```
</TabItem>
</Tabs>
For additional parameters, refer to the [marathon-cloud-cli README](https://github.com/MarathonLabs/marathon-cloud-cli/#installation).
26 changes: 26 additions & 0 deletions docs/docs/cloud/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: "Overview"
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

[Marathon Cloud](https://cloud.marathonlabs.io/) is a cloud testing infrastructure built on top of the Marathon test runner.
It automatically provisions virtual devices to accommodate your tests within 15 minutes.
The test execution is then delegated to Marathon test runner, which handles tasks such as batching,
sorting, preventive retries, and post-factum retries.
This ensures an even distribution of tests across the provisioned devices.

## Install

The installation can be performed using [Homebrew](https://brew.sh/):
```shell
brew install malinskiy/tap/marathon-cloud
```
Alternatively, you can download prebuilt binaries for Windows, Linux, or MacOS from [the Release page](https://github.com/MarathonLabs/marathon-cloud-cli/releases).

## API Key

Token creation and management are available at [the Tokens page](https://cloud.marathonlabs.io/tokens). Generate a token and save it somewhere safe for the next step.


12 changes: 12 additions & 0 deletions docs/docs/cloud/pricing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: "Pricing"
---

We operate on a Pay-As-You-Go model, meaning you only pay for the actual time spent running tests on our virtual devices. The pricing is set at a straightforward rate of $2 per hour for each virtual device.

## Billing
To better understand this, picture having a test suite that requires 2 hours and 15 minutes (or 135 minutes) to run on one device. With Marathon Cloud, we automatically deploy an infrastructure of 9 virtual devices for you (135 minutes / 9 devices = 15 minutes). We then evenly distribute the tests among these devices, run them, and deliver the results to you within just 15 minutes. However, your tests will have used up 2 hours and 15 minutes (or 2.25 hours) of our device time in total. This means the cost of this test run for you would be $4.5.

# Calculating Time per Device

The computation of time for each device during a test run is based on the time span from the beginning of the first test on that device to the end of the last test on the same device. This means we don't factor in the device booting process or the application installation stage. We do, however, take into account the brief pauses between tests and the periodic device clean-ups that occur when using a batching strategy. Typically, pauses between tests take only fractions of a second, but clean-ups can require up to 6-8 seconds.
4 changes: 3 additions & 1 deletion docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ const sidebars = {
label: 'Cloud',
collapsed: false,
items: [
'cloud'
'cloud/overview',
'cloud/getting-started',
'cloud/pricing'
]
}
],
Expand Down

0 comments on commit 50d841b

Please sign in to comment.