Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Investigate and create proposal #1588

Merged
merged 39 commits into from
Mar 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
01b9b63
Add flank basic activity diagram with description
jan-goral Feb 11, 2021
7dbea8e
Update docs/refactor/flank_run/flank_activity_diagram.md
jan-goral Feb 11, 2021
7c7999b
Update run android
pawelpasterz Feb 12, 2021
b814e61
Update create context action
pawelpasterz Feb 12, 2021
27347e5
Update with context condition
pawelpasterz Feb 12, 2021
9b1c5a3
change multi condition to split
pawelpasterz Feb 15, 2021
16f3135
Add iOS run
pawelpasterz Feb 15, 2021
875b2f8
Update poll matrices
pawelpasterz Feb 15, 2021
19b2857
Add result processing -- part 1
pawelpasterz Feb 15, 2021
249deb5
Update report generating
pawelpasterz Feb 15, 2021
5dcbca5
Add fetch artifacts and validation
pawelpasterz Feb 16, 2021
b08767a
extact contexts creation
pawelpasterz Feb 16, 2021
e77db5c
extract sharding
pawelpasterz Feb 16, 2021
3e57b68
Add additional steps
pawelpasterz Feb 16, 2021
8e9e8aa
Update iOS sharding
pawelpasterz Feb 16, 2021
d5dbc1e
Add flank refactor investigation, proposal & steps (WIP)
jan-goral Feb 18, 2021
1f03a38
Create google_api_usecases.md
adamfilipow92 Feb 18, 2021
e6980f9
git add missing file
jan-goral Feb 19, 2021
b644c46
Add google api usage investigation WIP
jan-goral Feb 19, 2021
652ab9a
Removed files containing only VisibleForTesting annotation
adamfilipow92 Feb 19, 2021
08ec943
update investigation.md
jan-goral Feb 22, 2021
6f367e1
update proposal.md
jan-goral Feb 23, 2021
ea9f500
Update google_api_usecases.md
adamfilipow92 Feb 23, 2021
6f05f36
Update google_api_usecases.md
adamfilipow92 Feb 23, 2021
557a9a4
update investigation.md
jan-goral Feb 25, 2021
922f654
Added Android Run Use Case
adamfilipow92 Feb 25, 2021
1b060e6
Update google_api_usecases.md
adamfilipow92 Feb 25, 2021
d4f9643
Add investigation about external API usage for AndroidRunCommand
jan-goral Feb 26, 2021
65aa635
Add investigation about external API usage for IosRunCommand
jan-goral Feb 26, 2021
d1b590c
Add Google API usage function call tree
jan-goral Feb 27, 2021
ad12782
Add some steps for data layer refactor
jan-goral Mar 1, 2021
4d8b28f
Add some steps for data layer refactor
jan-goral Mar 2, 2021
1eab4a9
Add some steps for data layer refactor
jan-goral Mar 9, 2021
b85c250
Update steps.md
jan-goral Mar 9, 2021
fb37510
Update steps.md
jan-goral Mar 9, 2021
f19efbe
Update steps.md
jan-goral Mar 10, 2021
91b6e78
Add JUnitTest and PerfMetrics steps.md
jan-goral Mar 16, 2021
003d00a
Add Artifacts to steps.md
jan-goral Mar 17, 2021
6aa260c
update
jan-goral Mar 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
448 changes: 448 additions & 0 deletions docs/gcloud/google_api_usecases.md

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions docs/refactor/diagram.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Flank Activity Diagram

![activity_diagram](http://www.plantuml.com/plantuml/proxy?cache=no&fmt=svg&src=https://raw.githubusercontent.com/Flank/flank/1317-flank-run-refactor/docs/refactor/uml/flank_activity_diagram.puml)

![ios_sharding](http://www.plantuml.com/plantuml/proxy?cache=no&fmt=svg&src=https://raw.githubusercontent.com/Flank/flank/1317-flank-run-refactor/docs/refactor/uml/flank_ios_sharding_diagram.puml)

![android_sharding](http://www.plantuml.com/plantuml/proxy?cache=no&fmt=svg&src=https://raw.githubusercontent.com/Flank/flank/1317-flank-run-refactor/docs/refactor/uml/flank_android_sharding_diagram.puml)

## Description

The diagram shows abstract view of all possible flank activities.

* The `#LightGreen` color relates to CLI commands.
* The `#LightBlue` color relates to domain scope.
* The default yellow color reserved for top-level functions that are not atomic and can be converted to `frame`.
* Frame can represent a package or rather the top-level function composed of other functions.
* The `#snow` color relates to low-level functions
* Low-level functions should be atomic ( can import only non-domain utils and third-party libraries? - consider ).
* Low-level functions cannot be converted to frame

The complete activity diagram will contain only low-level activities represented by `#snow` color.
All top-level functions represented by yellow activities contains hidden complexity and should be converted to frames.

# Layers
```
presentation (CLI) -> domain -> utils -> data
```
13 changes: 13 additions & 0 deletions docs/refactor/flank_run/flank_run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Flank run refactor

## References

* https://github.com/Flank/flank/issues/1317

# Insights

## Fix import dependencies

Only the cli commands can be aware of run package.
So any code inside the run package which is imported somewhere else then cli,
must be reorganized and moved outside the run package.
174 changes: 174 additions & 0 deletions docs/refactor/flank_run/flank_run_refactor_sdd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
# Flank run refactor [Not complete]

# References

* `https://github.com/Flank/flank/issues/1317`

# Motivation

Flank run is getting bigger over the time.
Currently, the amount of code related to test run is large,
so it could be hard to understand and keep in mind the whole process.
To make the work more convenient, faster and scalable, we should re-think
and reorganize the code between packages and files.

# Goals

* `All logic related to flank run grouped in one root package`
* `Package structure flat as possible.`
* `Flank run process simplified to sequence of synchronous atomic steps.`
* `Packages and code are easy to identify as steps.`

# Non-Goals

* `Refactor code related to other commands than flank run`

# Design

> Explain and diagram the technical design
>
> Identify risks and edge cases

# API

> What will the proposed API look like?

# Results

> What was the outcome of the project?

# Dependencies

> What is the project blocked on?

> What will be impacted by the project?

## Files

## ftl/run

```
ftl/run/
├── CancelLastRun.kt
├── DumpShards.kt
├── NewTestRun.kt
├── RefreshLastRun.kt
├── common
│ ├── FetchArtifacts.kt
│ ├── GetLastArgs.kt
│ ├── GetLastGcsPath.kt
│ ├── GetLastMatrices.kt
│ ├── PollMatrices.kt
│ ├── PrettyPrint.kt
│ ├── SaveSessionId.kt
│ └── UpdateMatrixFile.kt
├── exception
│ ├── ExceptionHandler.kt
│ ├── FlankException.kt
│ └── FlankExitCodes.kt
├── model
│ ├── AndroidMatrixTestShards.kt
│ ├── AndroidTestContext.kt
│ ├── AndroidTestShards.kt
│ ├── IosTestContext.kt
│ └── TestResult.kt
├── platform
│ ├── RunAndroidTests.kt
│ ├── RunIosTests.kt
│ ├── android
│ │ ├── AndroidTestConfig.kt
│ │ ├── CreateAndroidLoopConfig.kt
│ │ ├── CreateAndroidTestConfig.kt
│ │ ├── CreateAndroidTestContext.kt
│ │ ├── CreateInstrumentationConfig.kt
│ │ ├── CreateRoboConfig.kt
│ │ ├── GetAndroidMatrixShards.kt
│ │ ├── ResolveApks.kt
│ │ ├── UploadApks.kt
│ │ └── UploadOtherFiles.kt
│ ├── common
│ │ ├── AfterRunTests.kt
│ │ ├── BeforeRunMessage.kt
│ │ └── BeforeRunTests.kt
│ └── ios
│ ├── CreateGameloopTestContext.kt
│ ├── CreateIosTestContext.kt
│ └── CreateXcTestContext.kt
└── status
├── ExecutionStatus.kt
├── ExecutionStatusListPrinter.kt
├── ExecutionStatusPrinter.kt
├── OutputStyle.kt
└── TestMatrixStatusPrinter.kt


```

## Dependencies

* `ftl/args/AndroidArgs.kt`
* `ftl/args/AndroidArgsCompanion.kt`
* `ftl/args/ArgsHelper.kt`
* `ftl/args/CalculateShardsResult.kt`
* `ftl/args/FlankRoboDirective.kt`
* `ftl/args/IArgs.kt`
* `ftl/args/IgnoredTestCases.kt`
* `ftl/args/IosArgs.kt`
* `ftl/args/IosArgsCompanion.kt`
* `ftl/args/ShardChunks.kt`
* `ftl/args/ValidateAndroidArgs.kt`
* `ftl/args/ValidateIosArgs.kt`
* `ftl/args/yml/AppTestPair.kt`
* `ftl/config/FtlConstants.kt`
* `ftl/filter/TestFilters.kt`
* `ftl/gc/GcAndroidDevice.kt`
* `ftl/gc/GcAndroidTestMatrix.kt`
* `ftl/gc/GcIosMatrix.kt`
* `ftl/gc/GcIosTestMatrix.kt`
* `ftl/gc/GcStorage.kt`
* `ftl/gc/GcTesting.kt`
* `ftl/gc/GcTestMatrix.kt`
* `ftl/gc/GcToolResults.kt`
* `ftl/http/ExecuteWithRetry.kt`
* `ftl/ios/xctest/XcTestData.kt`
* `ftl/ios/xctest/XcTestRunFlow.kt`
* `ftl/ios/xctest/common/Util.kt`
* `ftl/json/MatrixMap.kt`
* `ftl/json/SavedMatrix.kt`
* `ftl/reports/output/OutputReport.kt`
* `ftl/reports/output/OutputReportLoggers.kt`
* `ftl/reports/util/ReportManager.kt`
* `ftl/shard/Chunk.kt`
* `ftl/shard/Shard.kt`
* `ftl/shard/TestCasesCreator.kt`
* `ftl/util/Artifacts.kt`
* `ftl/util/CrashReporter.kt`
* `ftl/util/FileReference.kt`
* `ftl/util/FlankTestMethod.kt`
* `ftl/util/FlowExt.kt`
* `ftl/util/MatrixState.kt`
* `ftl/util/ObfuscationGson.kt`
* `ftl/util/ShardCounter.kt`
* `ftl/util/StopWatch.kt`
* `ftl/util/TestMatrixExtension.kt`


# Testing

> How will the project be tested?

# Alternatives Considered [optional]

> Summarize alternative designs (pros & cons)

# Timeline [optional for regular tigers]

> Document milestones and deadlines.

DONE:

-

NEXT:

-
29 changes: 29 additions & 0 deletions docs/refactor/important_cli_commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
The list of Flank CLI commands that calls domain use cases

* `auth/LoginCommand.kt`
* `firebase/CancelCommand.kt`
* `firebase/RefreshCommand.kt`
* `firebase/test/android/configuration/AndroidLocalesDescribeCommand.kt`
* `firebase/test/android/configuration/AndroidLocalesListCommand.kt`
* `firebase/test/android/models/AndroidModelDescribeCommand.kt`
* `firebase/test/android/models/AndroidModelsListCommand.kt`
* `firebase/test/android/orientations/AndroidOrientationsListCommand.kt`
* `firebase/test/android/versions/AndroidVersionsDescribeCommand.kt`
* `firebase/test/android/versions/AndroidVersionsListCommand.kt`
* `firebase/test/android/AndroidDoctorCommand.kt`
* `firebase/test/android/AndroidRunCommand.kt`
* `firebase/test/android/AndroidTestEnvironmentCommand.kt`
* `firebase/test/ios/configuration/IosLocalesDescribeCommand.kt`
* `firebase/test/ios/configuration/IosLocalesListCommand.kt`
* `firebase/test/ios/models/IosModelDescribeCommand.kt`
* `firebase/test/ios/models/IosModelsListCommand.kt`
* `firebase/test/ios/orientations/IosOrientationsListCommand.kt`
* `firebase/test/ios/versions/IosVersionsDescribeCommand.kt`
* `firebase/test/ios/versions/IosVersionsListCommand.kt`
* `firebase/test/ios/IosDoctorCommand.kt`
* `firebase/test/ios/IosRunCommand.kt`
* `firebase/test/ios/IosTestEnvironmentCommand.kt`
* `firebase/test/ipblocks/IPBlocksListCommand.kt`
* `firebase/test/networkprofiles/NetworkProfilesDescribeCommand.kt`
* `firebase/test/networkprofiles/NetworkProfilesListCommand.kt`
* `firebase/test/providedsoftware/ProvidedSoftwareListCommand.kt`
Loading