Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangatuan committed Jan 7, 2024
1 parent c0705f3 commit 897d23c
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 19 deletions.
17 changes: 17 additions & 0 deletions Docs/Report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

# Supported report process

1. Danger ✅
2. Slack (In progress)

## Danger

1. Create a new Dangerfile to handle the process checking for leaks.
You can copy `Dangerfile.leaksReport` in the example project.

2. You can customize the Dangerfile to do your own things.

### Why do I need to create a separated Dangerfile?

Because the process checking for leaks will trigger Danger to run.
If you combine the leaks checking Dangerfile and your project Dangerfile to 1 Dangerfile only, the leaks process will execute your Danger logic as well.
17 changes: 17 additions & 0 deletions Docs/Subcommand.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

# How to use specific subcommand

1. Maestro

## Maestro

To use Maestro, you need to follow these steps:

1. Install Maestro. Learn more about `Maestro` [here](https://maestro.mobile.dev/)
2. Create a maestro flow to run simulate the flow in your app.
3. In your ci workflow, just call:
```bash
leaksdetector maestro -p $YOUR_APP_NAME -maestro-flow-path $YOUR_MAESTRO_FILE_PATH
```

4. If you want to report the result to your Pull request/Slack/..., please check out the Report section.
46 changes: 27 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,55 @@

This is a simple package that enables you to easily integrate the Memory leaks check to your CI workflow.

# Getting started

![Static Badge](https://img.shields.io/badge/status-active-brightgreen)

## Usage
# Table of Contents

Just need to follow these simple steps:
- Installation
- Usage
- Current supported testing frameworks
- How?
- References

1. Copy `Dangerfile.leaksReport` to your project. This contains the logic to get the leaks message and post to your Pull request. You can custom this Dangerfile.
Learn more about `Danger` [here](https://danger.systems/ruby/)
## Installation

2. Create a maestro flow to run simulate the flow in your app.
Learn more about `Maestro` [here](https://maestro.mobile.dev/)
You can go to [GitHub Releases](https://github.com/hoangatuan/MemoryLeaksCheck/releases) page to download release executable program.

3. In your ci workflow, just call:
## Usage

The most simple way to run the leaks checking process is:

```bash
leaksdetector $subcommand -p $YOUR_APP_NAME -d $PATH_TO_DANGER_LEAKS_REPORT_FILE
leaksdetector $subcommand -p $YOUR_APP_NAME
```

### How to use subcommands

Check out [this document](./Docs/Report.md) for how to use specific subcommands

### How to report the result to your development workflow

Check out [How to report leaks to your development workflow](./Docs/Report.md) for how to customize the process to send the result to your workflow

## Current testing frameworks

- [Maestro](https://maestro.mobile.dev/)
- [XCUITest](https://developer.apple.com/documentation/xctest) (XCUITest is not supported. Read more [here](./Docs/XCUITests.md)) ❌

### Why I used Maestro?

1. I need a testing tool which doesn't kill the program after the testing finished execution. And Maestro support that. Also Maestro is very easy to integrate & use.
2. XCUITest can not preserve running program after test execution. Read more at [here](./Docs/XCUITests.md)

## How it works

1. Use Maestro to simulate the UI flow in your app.
1. Use a testing tool to simulate the UI flow in your app.

2. Generate `memgraph` using `leaks` tool provided by Apple.
Find more about `leaks` tool and `memgraph` [here](https://developer.apple.com/videos/play/wwdc2018/416/)

3. Use `leaksdetector` program to proceed the `memgraph` file. If any leaks founded, it will use Danger to post a message to your PR/slack, ...

## Why I used Maestro?

1. I need a testing tool which doesn't kill the program after the testing finished execution. And Maestro support that. Also Maestro is very easy to integrate & use.
2. XCUITest can not preserve running program after test execution. Read more at [here](./Docs/XCUITests.md)

## How to support your testing frameworks

If you're using another UI testing framework which also support preserve the execution of the program after finish testing, you can create another PR to update the `leaksdetector`.
Expand All @@ -68,9 +78,7 @@ It's easy to do that, just need to follow these steps:

```

2. Open `ExecutorFactory.swift`, define your new UI testing frameworks to the `ExecutorType`, and add logic to generate it in the `createExecutor` func.

3. Add new `@Option` to the executable program if need
2. Go to `Commands` folder to create a new command for your testing framework. Please refer to `MaestroCommand`.

## Result

Expand Down

0 comments on commit 897d23c

Please sign in to comment.