From 8f3bbd53be8afa1dbb99feda1063e5210e4a3c01 Mon Sep 17 00:00:00 2001 From: Ryan Bourdais <67397011+ryanbourdais@users.noreply.github.com> Date: Mon, 27 Feb 2023 09:26:50 -0600 Subject: [PATCH] feat: add adp pull parameter (#68) * feat: add adb pull parameter --- .circleci/test-deploy.yml | 3 +++ src/commands/run-tests.yml | 19 +++++++++++++++++++ src/commands/start-emulator-and-run-tests.yml | 18 ++++++++++++++++++ src/jobs/run-ui-tests.yml | 19 +++++++++++++++++++ 4 files changed, 59 insertions(+) diff --git a/.circleci/test-deploy.yml b/.circleci/test-deploy.yml index f6bef1a..010e7d1 100644 --- a/.circleci/test-deploy.yml +++ b/.circleci/test-deploy.yml @@ -157,6 +157,9 @@ jobs: run-tests-working-directory: ./compose-samples/Jetchat post-run-tests-steps: - android/save-build-cache + pull-data: true + pull-data-path: storage + pull-data-target: "." test-fastlane: docker: diff --git a/src/commands/run-tests.yml b/src/commands/run-tests.yml index caefd76..9cd4204 100644 --- a/src/commands/run-tests.yml +++ b/src/commands/run-tests.yml @@ -25,6 +25,21 @@ parameters: description: Use this to configure the no_output_timeout value type: string default: 10m + pull-data: + description: | + Whether to pull data after running tests + type: boolean + default: false + pull-data-path: + description: | + Emulator directory to pull data from + type: string + default: data + pull-data-target: + description: | + Location to save pulled data + type: string + default: "." steps: - run: environment: @@ -35,3 +50,7 @@ steps: name: Run tests with max tries of <> working_directory: <> command: <> + - when: + condition: << parameters.pull-data >> + steps: + - run: adb pull << parameters.pull-data-path >> << parameters.pull-data-target >> diff --git a/src/commands/start-emulator-and-run-tests.yml b/src/commands/start-emulator-and-run-tests.yml index 32931ff..6849bfe 100644 --- a/src/commands/start-emulator-and-run-tests.yml +++ b/src/commands/start-emulator-and-run-tests.yml @@ -185,6 +185,21 @@ parameters: Whether to kill the emulators after the tests complete type: boolean default: true + pull-data: + description: | + Whether to pull data after running tests + type: boolean + default: false + pull-data-path: + description: | + Emulator directory to pull data from + type: string + default: data + pull-data-target: + description: | + Location to save pulled data + type: string + default: "." steps: - create-avd: @@ -223,6 +238,9 @@ steps: max-tries: << parameters.max-tries >> retry-interval: << parameters.retry-interval >> no-output-timeout: << parameters.no-output-timeout >> + pull-data: << parameters.pull-data >> + pull-data-path: << parameters.pull-data-path >> + pull-data-target: << parameters.pull-data-target >> - << parameters.post-run-tests-steps >> - when: condition: << parameters.save-gradle-cache >> diff --git a/src/jobs/run-ui-tests.yml b/src/jobs/run-ui-tests.yml index d5886c5..c7498ce 100644 --- a/src/jobs/run-ui-tests.yml +++ b/src/jobs/run-ui-tests.yml @@ -191,6 +191,22 @@ parameters: Whether to kill the emulators after the tests complete type: boolean default: true + pull-data: + description: | + Whether to pull data after running tests + type: boolean + default: false + pull-data-path: + description: | + Emulator directory to pull data from + type: string + default: data + pull-data-target: + description: | + Location to save pulled data + type: string + default: "." + executor: << parameters.executor >> steps: - when: @@ -233,3 +249,6 @@ steps: retry-interval: << parameters.retry-interval >> no-output-timeout: << parameters.no-output-timeout >> kill-emulators: << parameters.kill-emulators >> + pull-data: << parameters.pull-data >> + pull-data-path: << parameters.pull-data-path >> + pull-data-target: << parameters.pull-data-target >>