Skip to content

Commit

Permalink
Trying using only env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
ypolishchuk-ledger committed Aug 12, 2024
1 parent b88b172 commit a6ca4fd
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 36 deletions.
115 changes: 81 additions & 34 deletions .github/workflows/test-ui-e2e-only-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ permissions:
jobs:
e2e-tests-linux:
name: "Desktop Tests E2E (Ubuntu)"
outputs:
shard_outcomes: ${{ steps.collect-outcomes.outputs.shard_outcomes }}
# outputs:
# shard1_status: ${{ steps.set-status.outputs.shard1_status }}
# shard2_status: ${{ steps.set-status.outputs.shard2_status }}
# shard3_status: ${{ steps.set-status.outputs.shard3_status }}
env:
NODE_OPTIONS: "--max-old-space-size=7168"
INSTRUMENT_BUILD: true
Expand All @@ -78,7 +80,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.sha }}

- name: Setup broadcast environment variables
id: set-env
run: |
Expand Down Expand Up @@ -139,28 +141,35 @@ jobs:
XRAY: ${{ inputs.export_to_xray }}
TEST_EXECUTION: ${{ inputs.test_execution }}
PROJECT_KEY: B2CQA
continue-on-error: true
#continue-on-error: true

# - name: Set shard status output
# id: set-status
# if: always()
# run: |
# echo "shard${{ matrix.shardIndex }}_status=${{ steps.tests.outcome }}" >> $GITHUB_ENV
# echo "::set-output name=shard${{ matrix.shardIndex }}_status::${{ steps.tests.outcome }}"

#- name: Collect outcomes
# id: collect-outcomes
# run: echo "shard_outcome_${{ matrix.shardIndex }}=${{ steps.tests.outcome }}" >> $GITHUB_ENV

# shard_outcomes: ${{ steps.collect-outcomes.outputs.shard_outcomes }}

- name: Collect outcomes
id: collect-outcomes
run: |
if [ -z "$GITHUB_ENV" ]; then
echo "shard_outcomes=shard_${{ matrix.shardIndex }}=${{ steps.tests.outcome }}" >> $GITHUB_ENV
else
echo "shard_outcomes=${{ env.shard_outcomes }} shard_${{ matrix.shardIndex }}=${{ steps.tests.outcome }}" >> $GITHUB_ENV
fi

- name: Print shard outcomes
shell: bash
run: |
source $GITHUB_ENV
echo "Val shard_outcomes: $shard_outcomes"
# - name: Collect outcomes
# id: collect-outcomes
# run: |
# if [ -z "$GITHUB_ENV" ]; then
# echo "shard_outcomes=shard_${{ matrix.shardIndex }}=${{ steps.tests.outcome }}" >> $GITHUB_ENV
# else
# echo "shard_outcomes=${{ env.shard_outcomes }} shard_${{ matrix.shardIndex }}=${{ steps.tests.outcome }}" >> $GITHUB_ENV
# fi

# - name: Print shard outcomes
# shell: bash
# run: |
# source $GITHUB_ENV
# echo "Val shard_outcomes: $shard_outcomes"

- name: Upload Allure Results
if: ${{ !cancelled() }}
Expand All @@ -177,7 +186,7 @@ jobs:
retention-days: 1
name: xray-reports-${{ matrix.shardIndex }}
path: apps/ledger-live-desktop/tests/artifacts/xray/xray-report.json

report-and-notify:
name: "Report and Notify"
runs-on: [ledger-live-medium]
Expand All @@ -188,12 +197,12 @@ jobs:
with:
ref: ${{ inputs.ref || github.sha }}

- name: Print shard outcomes
shell: bash
run: |
source $GITHUB_ENV
echo "Val shard_outcomes: $shard_outcomes"
echo "Shard outcomes: ${{ needs.e2e-tests-linux.outputs.shard_outcomes }}"
# - name: Print shard outcomes
# shell: bash
# run: |
# source $GITHUB_ENV
# echo "Val shard_outcomes: $shard_outcomes"
# echo "Shard outcomes: ${{ needs.e2e-tests-linux.outputs.shard_outcomes }}"

#- name: Print e2e-tests-linux status
# if: ${{ !cancelled() }}
Expand Down Expand Up @@ -228,6 +237,7 @@ jobs:

- name: Get summary
if: ${{ !cancelled() }}
id: summary
shell: bash
run: |
cd apps/ledger-live-desktop
Expand All @@ -240,18 +250,54 @@ jobs:
totalTests=$(jq '.statistic.total' summary.json)
echo "TEST_RESULT=$passedTests passed, $failedTests failed, $brokenTests broken, $skippedTests skipped, $totalTests total" >> $GITHUB_ENV
- name: Get status color
if [ "$failedTests" -gt 0 ] || [ "$brokenTests" -gt 0 ]; then
echo "STATUS_COLOR=#FF333C" >> $GITHUB_ENV;
else
echo "STATUS_COLOR=#33FF39" >> $GITHUB_ENV;
fi
# - name: Get status color
# if: ${{ !cancelled() }}
# shell: bash
# run: |
# if [ "${{ needs.e2e-tests-linux.outputs.shard_outcomes }}" == *failure* ]; then
# echo "STATUS_COLOR=#FF333C" >> $GITHUB_ENV
# elif [ "${{ needs.e2e-tests-linux.outputs.shard_outcomes }}" == *success* ]; then
# echo "STATUS_COLOR=#33FF39" >> $GITHUB_ENV
# else
# echo "STATUS_COLOR=#F3FF33" >> $GITHUB_ENV
# fi

# - name: Debug shard statuses
# if: ${{ !cancelled() }}
# shell: bash
# run: |
# echo "Shard 1 Status: $shard1_status"
# echo "Shard 2 Status: $shard2_status"
# echo "Shard 3 Status: $shard3_status"

# - name: Get status color
# if: ${{ !cancelled() }}
# shell: bash
# run: |
# if [ "${{ needs.e2e-tests-linux.outputs.shard1_status }}" == "failure" ] || \
# [ "${{ needs.e2e-tests-linux.outputs.shard2_status }}" == "failure" ] || \
# [ "${{ needs.e2e-tests-linux.outputs.shard3_status }}" == "failure" ]; then
# echo "STATUS_COLOR=#FF333C" >> $GITHUB_ENV;
# elif [ "${{ needs.e2e-tests-linux.outputs.shard1_status }}" == "success" ] && \
# [ "${{ needs.e2e-tests-linux.outputs.shard2_status }}" == "success" ] && \
# [ "${{ needs.e2e-tests-linux.outputs.shard3_status }}" == "success" ]; then
# echo "STATUS_COLOR=#33FF39" >> $GITHUB_ENV;
# else
# echo "STATUS_COLOR=#F3FF33" >> $GITHUB_ENV;
# fi

- name: Debug status color
if: ${{ !cancelled() }}
shell: bash
run: |
if [ "${{ needs.e2e-tests-linux.outputs.shard_outcomes }}" == *failure* ]; then
echo "STATUS_COLOR=#FF333C" >> $GITHUB_ENV
elif [ "${{ needs.e2e-tests-linux.outputs.shard_outcomes }}" == *success* ]; then
echo "STATUS_COLOR=#33FF39" >> $GITHUB_ENV
else
echo "STATUS_COLOR=#F3FF33" >> $GITHUB_ENV
fi
echo "STATUS_COLOR is set to: $STATUS_COLOR"
- uses: actions/github-script@v6
if: ${{ !cancelled() }}
name: prepare status
Expand Down Expand Up @@ -397,6 +443,7 @@ jobs:
payload-file-path: ${{ github.workspace }}/payload-slack-content.json
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_LIVE_CI_BOT_TOKEN }}
STATUS_COLOR: ${{ env.STATUS_COLOR }}

upload-to-xray:
name: "Upload to Xray"
Expand Down
3 changes: 1 addition & 2 deletions apps/ledger-live-desktop/tests/enum/Account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ export class Account {
static readonly BTC_1 = new Account(
Currency.BTC,
"Bitcoin 1",
"test",
//"bc1qx7f9plgr8msjatkv0dw2ne8gguwfjqr6xyjp50",
"bc1qx7f9plgr8msjatkv0dw2ne8gguwfjqr6xyjp50",
);

static readonly BTC_2 = new Account(
Expand Down

0 comments on commit a6ca4fd

Please sign in to comment.