mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 12:40:35 +00:00
Integration test coverage (#4969)
* Integration test coverage POC * Update * Integration test cleanup * Fix * update tests > index 36 * rename stocks tests * Update Integration Tests * Update Integration Test Coverage * Update integration tests * Linting * Calculate parameter coverage * Improvements * Integration test update * Improvements * Improvements * Improvements * Improvements * Add to controller * Update README * Add integration test summary * Update integration tests * Update integration tests * Update algorithm * avoid uncaught exception * change summary * change workflow * another summawry change * fix small bug when module not found * summary table * Refactor * Workflow * Breaking get_coverage_all_controllers * Submenu coverage refactor * Remove comments * fix build workflow * forgot intel * update integration tests wf * update windows wd (need to test) * same * fix integration test * Windows patch * Update integration-test.yml * fix windows path * fix windows build wf * Update windows10_build.yml * Linting * fix paths * Finishing path touches --------- Co-authored-by: Diogo Sousa <montezdesousa@gmail.com> Co-authored-by: luqazino@gmail.com <luqazino@gmail.com> Co-authored-by: montezdesousa <79287829+montezdesousa@users.noreply.github.com>
This commit is contained in:
13
.github/workflows/integration-test.yml
vendored
13
.github/workflows/integration-test.yml
vendored
@@ -26,7 +26,6 @@ jobs:
|
||||
if: always()
|
||||
|
||||
- name: Checkout code
|
||||
if: github.event_name == 'push'
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Checkout specific ref
|
||||
@@ -69,7 +68,15 @@ jobs:
|
||||
run: |
|
||||
source $VENV
|
||||
python terminal.py -t | tee result.txt
|
||||
grep "================================ integration test summary ================================" result.txt -A100 | tail -c 2000 > failed_tests.txt
|
||||
grep "================================ Integration Test Summary ================================" result.txt -A100 | tail --bytes=2000 > summary.txt
|
||||
|
||||
- name: Run Integration Tests Coverage Report
|
||||
id: integration-tests-coverage
|
||||
run: |
|
||||
source $VENV
|
||||
python terminal.py -t --coverage | tee result.txt
|
||||
echo >> summary.txt
|
||||
sed -n '/Integration Coverage Summary/,$p' result.txt >> summary.txt
|
||||
|
||||
- name: Upload summary to Slack
|
||||
uses: adrey/slack-file-upload-action@master
|
||||
@@ -77,7 +84,7 @@ jobs:
|
||||
token: ${{ secrets.SLACK_API_TOKEN }}
|
||||
initial_comment: "Integration test summary"
|
||||
title: "Integration test summary"
|
||||
path: failed_tests.txt
|
||||
path: summary.txt
|
||||
channel: ${{ secrets.SLACK_CHANNEL_ID }}
|
||||
|
||||
- name: Slack Notification - Success/Failure
|
||||
|
||||
32
.github/workflows/macos-build.yml
vendored
32
.github/workflows/macos-build.yml
vendored
@@ -70,7 +70,8 @@ jobs:
|
||||
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
|
||||
MACOS_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PWD }}
|
||||
MACOS_CODESIGN_IDENTITY: ${{ secrets.MACOS_CODESIGN_IDENTITY }}
|
||||
run: | # when pushing to main, make to generate new cert, and utilize secrets to store new password, and identity
|
||||
run:
|
||||
| # when pushing to main, make to generate new cert, and utilize secrets to store new password, and identity
|
||||
echo "Ensuring Keychain with same name does not exist"
|
||||
rm -rf /Users/openbb/Library/Keychains/build.keychain-db
|
||||
echo "Decoding certificate"
|
||||
@@ -141,8 +142,14 @@ jobs:
|
||||
|
||||
- name: Run Integration Tests
|
||||
run: |
|
||||
extract/OpenBBTerminal.pkg/Payload/Applications/OpenBB\ Terminal/.OpenBB/OpenBBTerminal -t -s forecast cryptocurrency reports alternative economy futures econometrics dashboards portfolio stocks/test_stocks_options_screen.openbb stocks/test_stocks_options.openbb forex etf stocks/test_stocks_fa.openbb | tee result.txt
|
||||
grep "================================ integration test summary ================================" result.txt -A100 | tail --bytes=2000 > failed_tests.txt
|
||||
extract/OpenBBTerminal.pkg/Payload/Applications/OpenBB\ Terminal/.OpenBB/OpenBBTerminal -t -s forecast cryptocurrency reports alternative economy futures econometrics dashboards portfolio stocks/test_stocks_options_screen.openbb stocks/test_stocks_options.openbb forex etf stocks/test_stocks_fa.openbb | tee result.txt
|
||||
grep "================================ Integration Test Summary ================================" result.txt -A100 | tail --bytes=2000 > summary.txt
|
||||
|
||||
- name: Run Integration Tests Coverage Report
|
||||
run: |
|
||||
extract/OpenBBTerminal.pkg/Payload/Applications/OpenBB\ Terminal/.OpenBB/OpenBBTerminal -t --coverage | tee result.txt
|
||||
echo >> summary.txt
|
||||
sed -n '/Integration Coverage Summary/,$p' result.txt >> summary.txt
|
||||
|
||||
- name: Upload summary to Slack
|
||||
uses: adrey/slack-file-upload-action@master
|
||||
@@ -150,7 +157,7 @@ jobs:
|
||||
token: ${{ secrets.SLACK_API_TOKEN }}
|
||||
initial_comment: "MacOs Build Integration test summary"
|
||||
title: "MacOs Build Integration test summary"
|
||||
path: failed_tests.txt
|
||||
path: summary.txt
|
||||
channel: ${{ secrets.SLACK_CHANNEL_ID }}
|
||||
|
||||
- name: Remove OpenBB Folder
|
||||
@@ -159,7 +166,7 @@ jobs:
|
||||
rm -rf ~/Desktop/OPENBB-exports
|
||||
rm -rf extract/
|
||||
|
||||
# Job to build the MacOS Intel version of the Terminal===================================
|
||||
# Job to build the MacOS Intel version of the Terminal===================================
|
||||
Intel-MacOs-Build:
|
||||
name: Intel MacOS Build
|
||||
runs-on: [self-hosted, macos, x64]
|
||||
@@ -216,7 +223,8 @@ jobs:
|
||||
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
|
||||
MACOS_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PWD }}
|
||||
MACOS_CODESIGN_IDENTITY: ${{ secrets.MACOS_CODESIGN_IDENTITY }}
|
||||
run: | # when pushing to main, make to generate new cert, and utilize secrets to store new password, and identity
|
||||
run:
|
||||
| # when pushing to main, make to generate new cert, and utilize secrets to store new password, and identity
|
||||
echo "Ensuring Keychain with same name does not exist"
|
||||
rm -rf /Users/openbb/Library/Keychains/build.keychain-db
|
||||
echo "Decoding certificate"
|
||||
@@ -287,8 +295,14 @@ jobs:
|
||||
|
||||
- name: Run Integration Tests
|
||||
run: |
|
||||
extract/OpenBBTerminal.pkg/Payload/Applications/OpenBB\ Terminal/.OpenBB/OpenBBTerminal -t -s forecast cryptocurrency reports alternative economy futures econometrics dashboards portfolio stocks/test_stocks_options_screen.openbb stocks/test_stocks_options.openbb forex etf stocks/test_stocks_fa.openbb | tee result.txt
|
||||
grep "================================ integration test summary ================================" result.txt -A100 | tail --bytes=2000 > failed_tests.txt
|
||||
extract/OpenBBTerminal.pkg/Payload/Applications/OpenBB\ Terminal/.OpenBB/OpenBBTerminal -t -s forecast cryptocurrency reports alternative economy futures econometrics dashboards portfolio stocks/test_stocks_options_screen.openbb stocks/test_stocks_options.openbb forex etf stocks/test_stocks_fa.openbb | tee result.txt
|
||||
grep "================================ Integration Test Summary ================================" result.txt -A100 | tail --bytes=2000 > summary.txt
|
||||
|
||||
- name: Run Integration Tests Coverage Report
|
||||
run: |
|
||||
extract/OpenBBTerminal.pkg/Payload/Applications/OpenBB\ Terminal/.OpenBB/OpenBBTerminal -t --coverage | tee result.txt
|
||||
echo >> summary.txt
|
||||
sed -n '/Integration Coverage Summary/,$p' result.txt >> summary.txt
|
||||
|
||||
- name: Upload summary to Slack
|
||||
uses: adrey/slack-file-upload-action@master
|
||||
@@ -296,7 +310,7 @@ jobs:
|
||||
token: ${{ secrets.SLACK_API_TOKEN }}
|
||||
initial_comment: "MacOs Build Integration test summary"
|
||||
title: "Intel MacOs Build Integration test summary"
|
||||
path: failed_tests.txt
|
||||
path: summary.txt
|
||||
channel: ${{ secrets.SLACK_CHANNEL_ID }}
|
||||
|
||||
- name: Remove OpenBB Folder
|
||||
|
||||
10
.github/workflows/windows10_build.yml
vendored
10
.github/workflows/windows10_build.yml
vendored
@@ -105,7 +105,13 @@ jobs:
|
||||
- name: Run Integration Tests
|
||||
run: |
|
||||
dist\OpenBBTerminal\OpenBBTerminal.exe -t -s forecast cryptocurrency reports alternative economy futures econometrics dashboards portfolio stocks/test_stocks_options_screen.openbb stocks/test_stocks_options.openbb forex etf stocks/test_stocks_fa.openbb | tee result.txt
|
||||
Select-String "================================ integration test summary ================================" result.txt -Context 0,100 | Select-Object -Last 2000 | Out-File failed_tests.txt
|
||||
Select-String "================================ Integration Test Summary ================================" result.txt -Context 0,100 | Select-Object -Last 2000 | Out-File summary.txt
|
||||
|
||||
- name: Run Integration Tests Coverage Report
|
||||
run: |
|
||||
dist\OpenBBTerminal\OpenBBTerminal.exe -t --coverage | tee result.txt
|
||||
echo/ >> summary.txt
|
||||
Select-String "============================== Integration Coverage Summary ==============================" result.txt -Context 0,300 | Select-Object -Last 2000 >> summary.txt
|
||||
|
||||
- name: Upload summary to Slack
|
||||
uses: adrey/slack-file-upload-action@master
|
||||
@@ -113,7 +119,7 @@ jobs:
|
||||
token: ${{ secrets.SLACK_API_TOKEN }}
|
||||
initial_comment: "Windows Build Integration test summary"
|
||||
title: "Windows Build Integration test summary"
|
||||
path: failed_tests.txt
|
||||
path: summary.txt
|
||||
channel: ${{ secrets.SLACK_CHANNEL_ID }}
|
||||
|
||||
# Cleaning ------------------------
|
||||
|
||||
Reference in New Issue
Block a user