-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1592 from novasamatech/rc/8.2.0
Rc/8.2.0
- Loading branch information
Showing
341 changed files
with
9,333 additions
and
738 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
adb devices | ||
|
||
# Install debug app | ||
adb -s emulator-5554 install app/debug/app-debug.apk | ||
|
||
# Install instrumental tests | ||
adb -s emulator-5554 install test-app/androidTest/debug/app-debug-androidTest.apk | ||
|
||
# Run tests | ||
adb logcat -c && | ||
python - <<END | ||
import os | ||
import re | ||
import subprocess as sp | ||
import sys | ||
import threading | ||
import time | ||
done = False | ||
def update(): | ||
# prevent CI from killing the process for inactivity | ||
while not done: | ||
time.sleep(5) | ||
print ("Running...") | ||
t = threading.Thread(target=update) | ||
t.dameon = True | ||
t.start() | ||
def run(): | ||
os.system('adb wait-for-device') | ||
p = sp.Popen('adb shell am instrument -w -m -e debug false -e class "io.novafoundation.nova.balances.BalancesIntegrationTest" io.novafoundation.nova.debug.test/io.qameta.allure.android.runners.AllureAndroidJUnitRunner', | ||
shell=True, stdout=sp.PIPE, stderr=sp.PIPE, stdin=sp.PIPE) | ||
return p.communicate() | ||
success = re.compile(r'OK \(\d+ tests\)') | ||
stdout, stderr = run() | ||
stdout = stdout.decode('ISO-8859-1') | ||
stderr = stderr.decode('ISO-8859-1') | ||
done = True | ||
print (stderr) | ||
print (stdout) | ||
if success.search(stderr + stdout): | ||
sys.exit(0) | ||
else: | ||
sys.exit(1) # make sure we fail if the tests fail | ||
END | ||
EXIT_CODE=$? | ||
adb logcat -d '*:E' | ||
|
||
# Export results | ||
adb exec-out run-as io.novafoundation.nova.debug sh -c 'cd /data/data/io.novafoundation.nova.debug/files && tar cf - allure-results' > allure-results.tar | ||
|
||
exit $EXIT_CODE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
adb devices | ||
|
||
# Install debug app | ||
adb -s emulator-5554 install app/debug/app-debug.apk | ||
|
||
# Install instrumental tests | ||
adb -s emulator-5554 install test-app/androidTest/debug/app-debug-androidTest.apk | ||
|
||
# Run tests | ||
adb logcat -c && | ||
python - <<END | ||
import os | ||
import re | ||
import subprocess as sp | ||
import sys | ||
import threading | ||
import time | ||
done = False | ||
def update(): | ||
# prevent CI from killing the process for inactivity | ||
while not done: | ||
time.sleep(5) | ||
print ("Running...") | ||
t = threading.Thread(target=update) | ||
t.dameon = True | ||
t.start() | ||
def run(): | ||
os.system('adb wait-for-device') | ||
p = sp.Popen('adb shell am instrument -w -m -e notClass io.novafoundation.nova.balances.BalancesIntegrationTest -e package io.novafoundation.nova.debug io.novafoundation.nova.debug.test/io.qameta.allure.android.runners.AllureAndroidJUnitRunner', | ||
shell=True, stdout=sp.PIPE, stderr=sp.PIPE, stdin=sp.PIPE) | ||
return p.communicate() | ||
success = re.compile(r'OK \(\d+ tests\)') | ||
stdout, stderr = run() | ||
stdout = stdout.decode('ISO-8859-1') | ||
stderr = stderr.decode('ISO-8859-1') | ||
done = True | ||
print (stderr) | ||
print (stdout) | ||
if success.search(stderr + stdout): | ||
sys.exit(0) | ||
else: | ||
sys.exit(1) # make sure we fail if the tests fail | ||
END | ||
EXIT_CODE=$? | ||
adb logcat -d '*:E' | ||
|
||
# Export results | ||
adb exec-out run-as io.novafoundation.nova.debug sh -c 'cd /data/data/io.novafoundation.nova.debug/files && tar cf - allure-results' > allure-results.tar | ||
|
||
exit $EXIT_CODE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
name: Run balances tests | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 */8 * * *' | ||
|
||
jobs: | ||
develop-build: | ||
uses: novasamatech/nova-wallet-android/.github/workflows/android_build.yml@develop | ||
with: | ||
branch: ${{github.head_ref}} | ||
gradlew-command: assembleDebug | ||
upload-name: develop-apk | ||
run-tests: false | ||
secrets: inherit | ||
|
||
test-build: | ||
uses: novasamatech/nova-wallet-android/.github/workflows/android_build.yml@develop | ||
with: | ||
branch: ${{github.head_ref}} | ||
gradlew-command: assembleDebugAndroidTest | ||
upload-name: test-apk | ||
run-tests: false | ||
secrets: inherit | ||
|
||
run-tests: | ||
needs: [develop-build, test-build] | ||
runs-on: macos-13 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Download built artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: develop-apk | ||
path: app | ||
|
||
- name: Debug path | ||
run: | | ||
ls -laR app | ||
- name: Download instrumential test artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: test-apk | ||
path: test-app | ||
|
||
- name: Debug path | ||
run: | | ||
ls -laR test-app | ||
- name: Add permissions | ||
run: chmod +x .github/scripts/run_balances_test.sh | ||
|
||
- name: Run tests | ||
uses: reactivecircus/android-emulator-runner@v2 | ||
with: | ||
disable-animations: true | ||
profile: Nexus 6 | ||
api-level: 29 | ||
script: .github/scripts/run_balances_test.sh | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: anroid-results | ||
path: ./allure-results.tar | ||
|
||
report: | ||
needs: [run-tests] | ||
if: ${{ always() }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: artifacts | ||
|
||
- name: Unzip results | ||
run: | | ||
find artifacts -name allure-results.tar -exec tar -xvf {} \; | ||
- name: Debug path | ||
run: | | ||
ls -laR | ||
- name: Generate report | ||
uses: ./.github/workflows/report/ | ||
with: | ||
token: ${{ secrets.ACTIONS_DEPLOY_KEY }} | ||
keep-reports-history: 30 | ||
|
||
telegram-notification: | ||
needs: [report] | ||
runs-on: ubuntu-latest | ||
if: failure() | ||
steps: | ||
- name: Notify Telegram channel | ||
uses: appleboy/telegram-action@master | ||
with: | ||
to: ${{ secrets.TELEGRAM_TO }} | ||
token: ${{ secrets.TELEGRAM_TOKEN }} | ||
format: markdown | ||
message: | | ||
💸 Balances tests failed. | ||
Test Results: https://novasamatech.github.io/balances_test_result/${{ github.run_number }}/index.html | ||
Github run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Publish report to gh-pages | ||
description: That workflow will publish report to the github-pages | ||
inputs: | ||
keep-reports-history: | ||
description: "History storage depth, integer" | ||
required: true | ||
token: | ||
description: "Github PAT" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Get Allure history | ||
uses: actions/checkout@v4 | ||
if: always() | ||
continue-on-error: true | ||
with: | ||
repository: novasamatech/balances_test_result | ||
ref: gh-pages | ||
path: gh-pages | ||
|
||
- name: Allure Report action | ||
uses: simple-elf/allure-report-action@master | ||
if: always() | ||
with: | ||
allure_results: allure-results | ||
allure_history: allure-history | ||
keep_reports: ${{ inputs.keep-reports-history }} | ||
github_repo: balances_test_result | ||
github_repo_owner: novasamatech | ||
|
||
- name: Deploy report to Github Pages | ||
if: always() | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
deploy_key: ${{ inputs.token }} | ||
publish_branch: gh-pages | ||
publish_dir: allure-history | ||
external_repository: novasamatech/balances_test_result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,4 @@ app/*.apk | |
!/core-db/schemas/io.novafoundation.nova.core_db.AppDatabase/9.json | ||
|
||
google-services.json | ||
/bindings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.