Skip to content

Commit 8106b84

Browse files
iohk-bors[bot]Piotr Stachyra
andauthored
Merge #3188
3188: E2e tests: minor test and workflow updates r=piotr-iohk a=piotr-iohk <!-- Detail in a few bullet points the work accomplished in this PR. Before you submit, don't forget to: * Make sure the GitHub PR fields are correct: ✓ Set a good Title for your PR. ✓ Assign yourself to the PR. ✓ Assign one or more reviewer(s). ✓ Link to a Jira issue, and/or other GitHub issues or PRs. ✓ In the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages. * Don't waste reviewers' time: ✓ If it's a draft, select the Create Draft PR option. ✓ Self-review your changes to make sure nothing unexpected slipped through. * Try to make your intent clear: ✓ Write a good Description that explains what this PR is meant to do. ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding Jira ticket. ✓ Highlight what Testing you have done. ✓ Acknowledge any changes required to the Documentation. --> - [x] Minor updates to tests and workflows ### Comments <!-- Additional comments, links, or screenshots to attach, if any. --> ### Issue Number <!-- Reference the Jira/GitHub issue that this PR relates to, and which requirements it tackles. Note: Jira issues of the form ADP- will be auto-linked. --> Co-authored-by: Piotr Stachyra <piotr.stachyra@iohk.io>
2 parents 46772e1 + cd062e9 commit 8106b84

File tree

5 files changed

+46
-26
lines changed

5 files changed

+46
-26
lines changed

.github/workflows/e2e-docker.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
6363
- name: 💾 Cache node db
6464
id: cache
65-
uses: actions/cache@v2.1.4
65+
uses: actions/cache@v2.1.7
6666
with:
6767
path: test/e2e/state/node_db/${{ env.NETWORK }}
6868
key: node-db-docker-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }}
@@ -72,12 +72,12 @@ jobs:
7272
7373
- name: 💾 Cache wallet db
7474
id: cache-wallet
75-
uses: actions/cache@v2.1.4
75+
uses: actions/cache@v2.1.7
7676
with:
7777
path: test/e2e/state/wallet_db/${{ env.NETWORK }}
7878
key: wallet-db-${{ runner.os }}-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }}
7979
restore-keys: |
80-
wallet-db-${{ runner.os }}-${{ env.NETWORK }}-
80+
wallet-db-docker-${{ env.NETWORK }}-
8181
wallet-db-Linux-${{ env.NETWORK }}-
8282
8383
- name: 🚀 Start node and wallet

.github/workflows/e2e-linux.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
4242
- name: 💾 Cache node db
4343
id: cache
44-
uses: actions/cache@v2.1.4
44+
uses: actions/cache@v2.1.7
4545
with:
4646
path: test/e2e/state/node_db/${{ env.NETWORK }}
4747
key: node-db-${{ runner.os }}-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }}
@@ -50,7 +50,7 @@ jobs:
5050
5151
- name: 💾 Cache wallet db
5252
id: cache-wallet
53-
uses: actions/cache@v2.1.4
53+
uses: actions/cache@v2.1.7
5454
with:
5555
path: test/e2e/state/wallet_db/${{ env.NETWORK }}
5656
key: wallet-db-${{ runner.os }}-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }}

.github/workflows/e2e-macos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
4545
- name: 💾 Cache node db
4646
id: cache
47-
uses: actions/cache@v2.1.4
47+
uses: actions/cache@v2.1.7
4848
with:
4949
path: test/e2e/state/node_db/${{ env.NETWORK }}
5050
key: node-db-${{ runner.os }}-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }}
@@ -54,7 +54,7 @@ jobs:
5454
5555
- name: 💾 Cache wallet db
5656
id: cache-wallet
57-
uses: actions/cache@v2.1.4
57+
uses: actions/cache@v2.1.7
5858
with:
5959
path: test/e2e/state/wallet_db/${{ env.NETWORK }}
6060
key: wallet-db-${{ runner.os }}-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }}

.github/workflows/e2e-windows.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
4848
- name: 💾 Cache node db
4949
id: cache
50-
uses: actions/cache@v2.1.4
50+
uses: actions/cache@v2.1.7
5151
with:
5252
path: test/e2e/state/node_db/${{ env.NETWORK }}
5353
key: node-db-${{ runner.os }}-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }}
@@ -57,13 +57,13 @@ jobs:
5757
5858
- name: 💾 Cache wallet db
5959
id: cache-wallet
60-
uses: actions/cache@v2.1.4
60+
uses: actions/cache@v2.1.7
6161
with:
6262
path: test/e2e/state/wallet_db/${{ env.NETWORK }}
6363
key: wallet-db-${{ runner.os }}-${{ env.NETWORK }}-${{ steps.date-time.outputs.value }}
6464
restore-keys: |
6565
wallet-db-${{ runner.os }}-${{ env.NETWORK }}-
66-
66+
6767
- name: ⚙️ Setup (get latest bins and configs and decode fixtures)
6868
run: rake setup[%NETWORK%,%PR%]
6969

test/e2e/spec/e2e_spec.rb

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,16 @@ def run_contract(contract_setup, scripts)
133133
expect(burn[:tx_balanced].parsed_response).to eq burn[:tx_signed].parsed_response
134134

135135
# verify decoded unbalanced transaction includes assets minted and burned
136-
expect(mint[:tx_unbalanced]['assets_minted']).to eq assets
137-
expect(mint[:tx_unbalanced]['assets_burned']).to eq []
138-
expect(burn[:tx_unbalanced]['assets_minted']).to eq []
139-
expect(burn[:tx_unbalanced]['assets_burned']).to eq assets
136+
expect(mint[:tx_unbalanced]['assets_minted']['token_map']).to eq assets
137+
expect(mint[:tx_unbalanced]['assets_burned']['token_map']).to eq []
138+
expect(burn[:tx_unbalanced]['assets_minted']['token_map']).to eq []
139+
expect(burn[:tx_unbalanced]['assets_burned']['token_map']).to eq assets
140140

141141
# verify decoded balanced transaction includes assets minted and burned
142-
expect(mint[:tx_balanced]['assets_minted']).to eq assets
143-
expect(mint[:tx_balanced]['assets_burned']).to eq []
144-
expect(burn[:tx_balanced]['assets_minted']).to eq []
145-
expect(burn[:tx_balanced]['assets_burned']).to eq assets
142+
expect(mint[:tx_balanced]['assets_minted']['token_map']).to eq assets
143+
expect(mint[:tx_balanced]['assets_burned']['token_map']).to eq []
144+
expect(burn[:tx_balanced]['assets_minted']['token_map']).to eq []
145+
expect(burn[:tx_balanced]['assets_burned']['token_map']).to eq assets
146146
end
147147

148148
it "withdrawal" do
@@ -241,8 +241,8 @@ def run_contract(contract_setup, scripts)
241241
"quantity" => 1 }
242242

243243
# verify decoded transactions show that currency will be minted
244-
expect(r[:tx_unbalanced]['assets_minted']).to eq [apfel, banana]
245-
expect(r[:tx_balanced]['assets_minted']).to eq [apfel, banana]
244+
expect(r[:tx_unbalanced]['assets_minted']['token_map']).to eq [apfel, banana]
245+
expect(r[:tx_balanced]['assets_minted']['token_map']).to eq [apfel, banana]
246246

247247
# make sure currency is minted as expected
248248
src_balance = get_shelley_balances(@wid)
@@ -283,7 +283,10 @@ def run_contract(contract_setup, scripts)
283283
tx_constructed = SHELLEY.transactions.construct(@wid, payment)
284284
expect(tx_constructed).to be_correct_and_respond 202
285285
expected_fee = tx_constructed['fee']['quantity']
286-
decoded_fee = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])['fee']['quantity']
286+
tx_decoded = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])
287+
expect(tx_decoded).to be_correct_and_respond 202
288+
289+
decoded_fee = tx_decoded['fee']['quantity']
287290
expect(expected_fee).to eq decoded_fee
288291

289292
tx_signed = SHELLEY.transactions.sign(@wid, PASS, tx_constructed['transaction'])
@@ -324,7 +327,10 @@ def run_contract(contract_setup, scripts)
324327
tx_constructed = SHELLEY.transactions.construct(@wid, payment)
325328
expect(tx_constructed).to be_correct_and_respond 202
326329
expected_fee = tx_constructed['fee']['quantity']
327-
decoded_fee = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])['fee']['quantity']
330+
tx_decoded = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])
331+
expect(tx_decoded).to be_correct_and_respond 202
332+
333+
decoded_fee = tx_decoded['fee']['quantity']
328334
expect(expected_fee).to eq decoded_fee
329335

330336
tx_signed = SHELLEY.transactions.sign(@wid, PASS, tx_constructed['transaction'])
@@ -371,7 +377,10 @@ def run_contract(contract_setup, scripts)
371377
tx_constructed = SHELLEY.transactions.construct(@wid, payment)
372378
expect(tx_constructed).to be_correct_and_respond 202
373379
expected_fee = tx_constructed['fee']['quantity']
374-
decoded_fee = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])['fee']['quantity']
380+
tx_decoded = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])
381+
expect(tx_decoded).to be_correct_and_respond 202
382+
383+
decoded_fee = tx_decoded['fee']['quantity']
375384
expect(expected_fee).to eq decoded_fee
376385

377386
tx_signed = SHELLEY.transactions.sign(@wid, PASS, tx_constructed['transaction'])
@@ -419,7 +428,10 @@ def run_contract(contract_setup, scripts)
419428
withdrawal = tx_constructed['coin_selection']['withdrawals'].map { |x| x['amount']['quantity'] }.first
420429
expect(withdrawal).to eq 0
421430
expected_fee = tx_constructed['fee']['quantity']
422-
decoded_fee = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])['fee']['quantity']
431+
tx_decoded = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])
432+
expect(tx_decoded).to be_correct_and_respond 202
433+
434+
decoded_fee = tx_decoded['fee']['quantity']
423435
expect(expected_fee).to eq decoded_fee
424436

425437
tx_signed = SHELLEY.transactions.sign(@wid, PASS, tx_constructed['transaction'])
@@ -451,7 +463,10 @@ def run_contract(contract_setup, scripts)
451463
metadata)
452464
expect(tx_constructed).to be_correct_and_respond 202
453465
expected_fee = tx_constructed['fee']['quantity']
454-
decoded_fee = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])['fee']['quantity']
466+
tx_decoded = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])
467+
expect(tx_decoded).to be_correct_and_respond 202
468+
469+
decoded_fee = tx_decoded['fee']['quantity']
455470
expect(expected_fee).to eq decoded_fee
456471

457472
tx_signed = SHELLEY.transactions.sign(@wid, PASS, tx_constructed['transaction'])
@@ -548,6 +563,8 @@ def run_contract(contract_setup, scripts)
548563

549564
# Check fee and deposit on quitting
550565
decoded_tx = SHELLEY.transactions.decode(@target_id, tx_constructed["transaction"])
566+
expect(decoded_tx).to be_correct_and_respond 202
567+
551568
expect(tx_constructed['coin_selection']['deposits_taken']).to eq []
552569
expect(decoded_tx['deposits_taken']).to eq []
553570
deposit_returned = tx_constructed['coin_selection']['deposits_returned'].first['quantity']
@@ -1237,7 +1254,10 @@ def test_byron_assets_tx(source_id, target_id)
12371254
tx_constructed = SHELLEY.transactions.construct(@wid, payment)
12381255
expect(tx_constructed).to be_correct_and_respond 202
12391256
expected_fee = tx_constructed['fee']['quantity']
1240-
decoded_fee = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])['fee']['quantity']
1257+
tx_decoded = SHELLEY.transactions.decode(@wid, tx_constructed["transaction"])
1258+
expect(tx_decoded).to be_correct_and_respond 202
1259+
1260+
decoded_fee = tx_decoded['fee']['quantity']
12411261
expect(expected_fee).to eq decoded_fee
12421262

12431263
tx_signed = SHELLEY.transactions.sign(@wid, PASS, tx_constructed['transaction'])

0 commit comments

Comments
 (0)