Skip to content

Commit

Permalink
Merge pull request #134 from mkoura/links_to_tests
Browse files Browse the repository at this point in the history
Include links to tests in allure reports
  • Loading branch information
mkoura committed Sep 21, 2020
2 parents 0ac9d19 + a7a0a47 commit 26226cf
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 11 deletions.
27 changes: 27 additions & 0 deletions cardano_node_tests/tests/test_pools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from pathlib import Path
from typing import List

import allure
import hypothesis
import hypothesis.strategies as st
import pytest
Expand Down Expand Up @@ -291,6 +292,7 @@ def _create_register_pool_tx_delegate_stake_tx(


class TestStakePool:
@allure.link(helpers.get_vcs_link())
def test_stake_pool_metadata(
self,
cluster_manager: parallel_run.ClusterManager,
Expand Down Expand Up @@ -343,6 +345,7 @@ def test_stake_pool_metadata(
pool_data=pool_data,
)

@allure.link(helpers.get_vcs_link())
def test_stake_pool_metadata_not_avail(
self,
cluster_manager: parallel_run.ClusterManager,
Expand Down Expand Up @@ -396,6 +399,7 @@ def test_stake_pool_metadata_not_avail(
)

@pytest.mark.parametrize("no_of_addr", [1, 3])
@allure.link(helpers.get_vcs_link())
def test_create_stake_pool(
self,
cluster_manager: parallel_run.ClusterManager,
Expand Down Expand Up @@ -435,6 +439,7 @@ def test_create_stake_pool(
)

@pytest.mark.parametrize("no_of_addr", [1, 3])
@allure.link(helpers.get_vcs_link())
def test_deregister_stake_pool(
self,
cluster_manager: parallel_run.ClusterManager,
Expand Down Expand Up @@ -530,6 +535,7 @@ def test_deregister_stake_pool(
== src_register_reward + cluster.get_pool_deposit()
)

@allure.link(helpers.get_vcs_link())
def test_reregister_stake_pool(
self,
cluster_manager: parallel_run.ClusterManager,
Expand Down Expand Up @@ -644,6 +650,7 @@ def test_reregister_stake_pool(
)

@pytest.mark.parametrize("no_of_addr", [1, 2])
@allure.link(helpers.get_vcs_link())
def test_update_stake_pool_metadata(
self,
cluster_manager: parallel_run.ClusterManager,
Expand Down Expand Up @@ -729,6 +736,7 @@ def test_update_stake_pool_metadata(
)

@pytest.mark.parametrize("no_of_addr", [1, 2])
@allure.link(helpers.get_vcs_link())
def test_update_stake_pool_parameters(
self,
cluster_manager: parallel_run.ClusterManager,
Expand Down Expand Up @@ -799,6 +807,7 @@ def test_update_stake_pool_parameters(
pool_data=pool_data_updated,
)

@allure.link(helpers.get_vcs_link())
def test_sign_in_multiple_stages(
self,
cluster_manager: parallel_run.ClusterManager,
Expand Down Expand Up @@ -945,6 +954,7 @@ def pool_owners(

@hypothesis.given(pool_cost=st.integers(max_value=4999)) # minPoolCost is now 5000
@hypothesis.settings(deadline=None, suppress_health_check=(hypothesis.HealthCheck.too_slow,))
@allure.link(helpers.get_vcs_link())
def test_stake_pool_low_cost(
self,
cluster_mincost: clusterlib.ClusterLib,
Expand Down Expand Up @@ -975,6 +985,7 @@ def test_stake_pool_low_cost(
assert expected_msg in str(excinfo.value)

@pytest.mark.parametrize("pool_cost", [5000, 9999999])
@allure.link(helpers.get_vcs_link())
def test_stake_pool_cost(
self,
cluster_manager: parallel_run.ClusterManager,
Expand Down Expand Up @@ -1057,6 +1068,7 @@ def pool_data(self) -> clusterlib.PoolData:
)
return pool_data

@allure.link(helpers.get_vcs_link())
def test_pool_registration_cert_wrong_vrf(
self,
cluster: clusterlib.ClusterLib,
Expand All @@ -1076,6 +1088,7 @@ def test_pool_registration_cert_wrong_vrf(
)
assert "Expected: VrfVerificationKey_PraosVRF" in str(excinfo.value)

@allure.link(helpers.get_vcs_link())
def test_pool_registration_cert_wrong_cold(
self,
cluster: clusterlib.ClusterLib,
Expand All @@ -1095,6 +1108,7 @@ def test_pool_registration_cert_wrong_cold(
)
assert "Expected: StakePoolVerificationKey" in str(excinfo.value)

@allure.link(helpers.get_vcs_link())
def test_pool_registration_cert_wrong_stake(
self,
cluster: clusterlib.ClusterLib,
Expand All @@ -1114,6 +1128,7 @@ def test_pool_registration_cert_wrong_stake(
)
assert "Expected: StakeVerificationKeyShelley" in str(excinfo.value)

@allure.link(helpers.get_vcs_link())
def test_pool_registration_missing_cold_skey(
self,
cluster: clusterlib.ClusterLib,
Expand Down Expand Up @@ -1143,6 +1158,7 @@ def test_pool_registration_missing_cold_skey(
cluster.send_tx(src_address=pool_users[0].payment.address, tx_files=tx_files)
assert "MissingVKeyWitnessesUTXOW" in str(excinfo.value)

@allure.link(helpers.get_vcs_link())
def test_pool_registration_missing_payment_skey(
self,
cluster: clusterlib.ClusterLib,
Expand Down Expand Up @@ -1172,6 +1188,7 @@ def test_pool_registration_missing_payment_skey(
cluster.send_tx(src_address=pool_users[0].payment.address, tx_files=tx_files)
assert "Expected one of" in str(excinfo.value)

@allure.link(helpers.get_vcs_link())
def test_pool_registration_conflicting_certs(
self,
cluster: clusterlib.ClusterLib,
Expand Down Expand Up @@ -1211,6 +1228,7 @@ def test_pool_registration_conflicting_certs(
cluster.send_tx(src_address=pool_users[0].payment.address, tx_files=tx_files)
assert "TextView type error" in str(excinfo.value)

@allure.link(helpers.get_vcs_link())
def test_pool_deregistration_not_registered(
self,
cluster: clusterlib.ClusterLib,
Expand All @@ -1235,6 +1253,7 @@ def test_pool_deregistration_not_registered(
cluster.send_tx(src_address=pool_users[0].payment.address, tx_files=tx_files)
assert "StakePoolNotRegisteredOnKeyPOOL" in str(excinfo.value)

@allure.link(helpers.get_vcs_link())
def test_stake_pool_metadata_no_name(
self,
cluster: clusterlib.ClusterLib,
Expand All @@ -1256,6 +1275,7 @@ def test_stake_pool_metadata_no_name(
cluster.gen_pool_metadata_hash(pool_metadata_file)
assert 'key "name" not found' in str(excinfo.value)

@allure.link(helpers.get_vcs_link())
def test_stake_pool_metadata_no_description(
self,
cluster: clusterlib.ClusterLib,
Expand All @@ -1277,6 +1297,7 @@ def test_stake_pool_metadata_no_description(
cluster.gen_pool_metadata_hash(pool_metadata_file)
assert 'key "description" not found' in str(excinfo.value)

@allure.link(helpers.get_vcs_link())
def test_stake_pool_metadata_no_ticker(
self,
cluster: clusterlib.ClusterLib,
Expand All @@ -1298,6 +1319,7 @@ def test_stake_pool_metadata_no_ticker(
cluster.gen_pool_metadata_hash(pool_metadata_file)
assert 'key "ticker" not found' in str(excinfo.value)

@allure.link(helpers.get_vcs_link())
def test_stake_pool_metadata_no_homepage(
self,
cluster: clusterlib.ClusterLib,
Expand All @@ -1321,6 +1343,7 @@ def test_stake_pool_metadata_no_homepage(

@hypothesis.given(pool_name=st.text(min_size=51))
@hypothesis.settings(deadline=None, suppress_health_check=(hypothesis.HealthCheck.too_slow,))
@allure.link(helpers.get_vcs_link())
def test_stake_pool_metadata_long_name(
self,
cluster: clusterlib.ClusterLib,
Expand Down Expand Up @@ -1350,6 +1373,7 @@ def test_stake_pool_metadata_long_name(

@hypothesis.given(pool_description=st.text(min_size=256))
@hypothesis.settings(deadline=None, suppress_health_check=(hypothesis.HealthCheck.too_slow,))
@allure.link(helpers.get_vcs_link())
def test_stake_pool_metadata_long_description(
self,
cluster: clusterlib.ClusterLib,
Expand Down Expand Up @@ -1379,6 +1403,7 @@ def test_stake_pool_metadata_long_description(

@hypothesis.given(pool_ticker=st.text())
@hypothesis.settings(deadline=None, suppress_health_check=(hypothesis.HealthCheck.too_slow,))
@allure.link(helpers.get_vcs_link())
def test_stake_pool_metadata_long_ticker(
self,
cluster: clusterlib.ClusterLib,
Expand Down Expand Up @@ -1406,6 +1431,7 @@ def test_stake_pool_metadata_long_ticker(

@hypothesis.given(pool_homepage=st.text(min_size=425))
@hypothesis.settings(deadline=None, suppress_health_check=(hypothesis.HealthCheck.too_slow,))
@allure.link(helpers.get_vcs_link())
def test_stake_pool_metadata_long_homepage(
self,
cluster: clusterlib.ClusterLib,
Expand All @@ -1429,6 +1455,7 @@ def test_stake_pool_metadata_long_homepage(
cluster.gen_pool_metadata_hash(pool_metadata_file)
assert "Stake pool metadata must consist of at most 512 bytes" in str(excinfo.value)

@allure.link(helpers.get_vcs_link())
def test_stake_pool_long_metadata_url(
self,
cluster: clusterlib.ClusterLib,
Expand Down
17 changes: 17 additions & 0 deletions cardano_node_tests/tests/test_staking.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import Dict
from typing import List

import allure
import pytest
from _pytest.tmpdir import TempdirFactory

Expand Down Expand Up @@ -155,6 +156,7 @@ def _delegate_stake_addr(


class TestDelegateAddr:
@allure.link(helpers.get_vcs_link())
def test_delegate_using_pool_id(
self,
cluster_manager: parallel_run.ClusterManager,
Expand All @@ -174,6 +176,7 @@ def test_delegate_using_pool_id(
pool_name=pool_name,
)

@allure.link(helpers.get_vcs_link())
def test_delegate_using_vkey(
self,
cluster_manager: parallel_run.ClusterManager,
Expand All @@ -192,6 +195,7 @@ def test_delegate_using_vkey(
pool_name=pool_name,
)

@allure.link(helpers.get_vcs_link())
def test_deregister(
self,
cluster_manager: parallel_run.ClusterManager,
Expand Down Expand Up @@ -262,6 +266,7 @@ def test_deregister(
not stake_addr_info.delegation
), f"Stake address is still delegated: {stake_addr_info}"

@allure.link(helpers.get_vcs_link())
def test_addr_registration_deregistration(
self,
cluster: clusterlib.ClusterLib,
Expand Down Expand Up @@ -299,6 +304,7 @@ def test_addr_registration_deregistration(
== src_init_balance - tx_raw_output.fee
), f"Incorrect balance for source address `{user_payment.address}`"

@allure.link(helpers.get_vcs_link())
def test_addr_delegation_deregistration(
self,
cluster_manager: parallel_run.ClusterManager,
Expand Down Expand Up @@ -371,6 +377,7 @@ def test_addr_delegation_deregistration(


class TestNegative:
@allure.link(helpers.get_vcs_link())
def test_registration_cert_with_wrong_key(
self,
cluster: clusterlib.ClusterLib,
Expand All @@ -386,6 +393,7 @@ def test_registration_cert_with_wrong_key(
)
assert "Expected: StakeVerificationKeyShelley" in str(excinfo.value)

@allure.link(helpers.get_vcs_link())
def test_delegation_cert_with_wrong_key(
self,
cluster_manager: parallel_run.ClusterManager,
Expand All @@ -407,6 +415,7 @@ def test_delegation_cert_with_wrong_key(
)
assert "Expected: StakeVerificationKeyShelley" in str(excinfo.value)

@allure.link(helpers.get_vcs_link())
def test_register_addr_with_wrong_key(
self,
cluster: clusterlib.ClusterLib,
Expand Down Expand Up @@ -434,6 +443,7 @@ def test_register_addr_with_wrong_key(
cluster.send_tx(src_address=user_payment.address, tx_files=tx_files)
assert "MissingVKeyWitnessesUTXOW" in str(excinfo.value)

@allure.link(helpers.get_vcs_link())
def test_delegate_addr_with_wrong_key(
self,
cluster_manager: parallel_run.ClusterManager,
Expand Down Expand Up @@ -480,6 +490,7 @@ def test_delegate_addr_with_wrong_key(
cluster.send_tx(src_address=user_payment.address, tx_files=tx_files)
assert "MissingVKeyWitnessesUTXOW" in str(excinfo.value)

@allure.link(helpers.get_vcs_link())
def test_delegate_unregistered_addr(
self,
cluster_manager: parallel_run.ClusterManager,
Expand Down Expand Up @@ -513,6 +524,7 @@ def test_delegate_unregistered_addr(
cluster.send_tx(src_address=user_payment.address, tx_files=tx_files)
assert "StakeDelegationImpossibleDELEG" in str(excinfo.value)

@allure.link(helpers.get_vcs_link())
def test_unregister_not_registered_addr(
self,
cluster: clusterlib.ClusterLib,
Expand Down Expand Up @@ -540,6 +552,7 @@ def test_unregister_not_registered_addr(


class TestRewards:
@allure.link(helpers.get_vcs_link())
def test_reward_amount(
self,
cluster_manager: parallel_run.ClusterManager,
Expand Down Expand Up @@ -601,6 +614,7 @@ def test_reward_amount(
# withdraw rewards to payment address
helpers.withdraw_reward(cluster_obj=cluster, pool_user=pool_user)

@allure.link(helpers.get_vcs_link())
def test_no_reward_unmet_pledge(
self,
cluster_manager: parallel_run.ClusterManager,
Expand Down Expand Up @@ -716,6 +730,7 @@ def test_no_reward_unmet_pledge(
< cluster.get_stake_addr_info(pool_rec["reward"].address).reward_account_balance
), "New reward was not received by pool reward address"

@allure.link(helpers.get_vcs_link())
def test_no_reward_unmet_pledge2(
self,
cluster_manager: parallel_run.ClusterManager,
Expand Down Expand Up @@ -847,6 +862,7 @@ def test_no_reward_unmet_pledge2(
< cluster.get_stake_addr_info(pool_rec["reward"].address).reward_account_balance
), "New reward was not received by pool reward address"

@allure.link(helpers.get_vcs_link())
def test_no_reward_unregistered_stake_addr(
self,
cluster_manager: parallel_run.ClusterManager,
Expand Down Expand Up @@ -990,6 +1006,7 @@ def test_no_reward_unregistered_stake_addr(
< cluster.get_stake_addr_info(pool_rec["reward"].address).reward_account_balance
), "New reward was not received by pool reward address"

@allure.link(helpers.get_vcs_link())
def test_no_reward_unregistered_reward_addr(
self,
cluster_manager: parallel_run.ClusterManager,
Expand Down
Loading

0 comments on commit 26226cf

Please sign in to comment.