Skip to content

Commit

Permalink
feat[test]: remove memory mocker (#4005)
Browse files Browse the repository at this point in the history
it doesn't really find bugs (since the calling convention was redone in
0.3.0) and we have better ways to analyze memory now since the
introduction of the venom pipeline (cf. changes in 7d28a50)
  • Loading branch information
charles-cooper authored May 6, 2024
1 parent ace3789 commit 6c272b7
Show file tree
Hide file tree
Showing 16 changed files with 6 additions and 99 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ jobs:
debug: [true, false]
evm-version: [shanghai]
experimental-codegen: [false]
memorymock: [false]
evm-backend: [revm]

# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations
Expand Down Expand Up @@ -118,14 +117,6 @@ jobs:
experimental-codegen: true
# TODO: test experimental_codegen + -Ocodesize

# run with `--memorymock`, but only need to do it one configuration
# TODO: consider removing the memorymock tests
- python-version: ["3.11", "311"]
opt-mode: gas
debug: false
evm-version: shanghai
memorymock: true

# run across other python versions. we don't really need to run all
# modes across all python versions - one is enough
- python-version: ["3.10", "310"]
Expand All @@ -141,7 +132,6 @@ jobs:
name: "py${{ matrix.python-version[1] }}\
-opt-${{ matrix.opt-mode }}\
${{ matrix.debug && '-debug' || '' }}\
${{ matrix.memorymock && '-memorymock' || '' }}\
${{ matrix.experimental-codegen && '-experimental' || '' }}\
-${{ matrix.evm-version }}\
${{ matrix.evm-backend && format('-{0}', matrix.evm-backend) || '' }}"
Expand Down Expand Up @@ -172,7 +162,6 @@ jobs:
--evm-version ${{ matrix.evm-version }} \
${{ matrix.evm-backend && format('--evm-backend {0}', matrix.evm-backend) || '' }} \
${{ matrix.debug && '--enable-compiler-debug-mode' || '' }} \
${{ matrix.memorymock && '--memorymock' || '' }} \
${{ matrix.experimental-codegen && '--experimental-codegen' || '' }} \
--cov-branch \
--cov-report xml:coverage.xml \
Expand Down
3 changes: 0 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
from vyper.ir import compile_ir, optimizer
from vyper.utils import keccak256

# Import the base fixtures
pytest_plugins = ["tests.fixtures.memorymock"]

############
# PATCHING #
############
Expand Down
Empty file removed tests/fixtures/__init__.py
Empty file.
51 changes: 0 additions & 51 deletions tests/fixtures/memorymock.py

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/builtins/codegen/test_raw_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
from vyper.builtins.functions import eip1167_bytecode
from vyper.exceptions import ArgumentException, StateAccessViolation, TypeMismatch

pytestmark = pytest.mark.usefixtures("memory_mocker")


def test_max_outsize_exceeds_returndatasize(get_contract):
source_code = """
Expand Down
4 changes: 0 additions & 4 deletions tests/functional/builtins/codegen/test_sha256.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import hashlib

import pytest

from vyper.utils import hex_to_int

pytestmark = pytest.mark.usefixtures("memory_mocker")


def test_sha256_string_literal(get_contract):
code = """
Expand Down
2 changes: 0 additions & 2 deletions tests/functional/codegen/calling_convention/test_return.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from vyper import compile_code
from vyper.exceptions import TypeMismatch

pytestmark = pytest.mark.usefixtures("memory_mocker")


def test_correct_abi_right_padding(env, get_contract):
selfcall_code_6 = """
Expand Down
10 changes: 5 additions & 5 deletions tests/functional/codegen/features/test_assert.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def foo():
assert env.last_result.gas_used < gas_sent


def test_assert_reason(env, get_contract, tx_failed, memory_mocker):
def test_assert_reason(env, get_contract, tx_failed):
code = """
err: String[32]
Expand Down Expand Up @@ -134,7 +134,7 @@ def test_valid_assertions(get_contract, code):
get_contract(code)


def test_assert_staticcall(get_contract, env, tx_failed, memory_mocker):
def test_assert_staticcall(get_contract, env, tx_failed):
foreign_code = """
state: uint256
@external
Expand All @@ -158,7 +158,7 @@ def test(c: ForeignContract):
c2.test(c1.address)


def test_assert_in_for_loop(get_contract, tx_failed, memory_mocker):
def test_assert_in_for_loop(get_contract, tx_failed):
code = """
@external
def test(x: uint256[3]) -> bool:
Expand All @@ -178,7 +178,7 @@ def test(x: uint256[3]) -> bool:
c.test([1, 3, 5])


def test_assert_with_reason_in_for_loop(get_contract, tx_failed, memory_mocker):
def test_assert_with_reason_in_for_loop(get_contract, tx_failed):
code = """
@external
def test(x: uint256[3]) -> bool:
Expand All @@ -198,7 +198,7 @@ def test(x: uint256[3]) -> bool:
c.test([1, 3, 5])


def test_assert_reason_revert_length(env, get_contract, tx_failed, memory_mocker):
def test_assert_reason_revert_length(env, get_contract, tx_failed):
code = """
@external
def test() -> int128:
Expand Down
2 changes: 0 additions & 2 deletions tests/functional/codegen/features/test_internal_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
from vyper.compiler import compile_code
from vyper.exceptions import ArgumentException, CallViolation

pytestmark = pytest.mark.usefixtures("memory_mocker")


def test_selfcall_code(get_contract):
selfcall_code = """
Expand Down
2 changes: 0 additions & 2 deletions tests/functional/codegen/features/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
)
from vyper.utils import keccak256

pytestmark = pytest.mark.usefixtures("memory_mocker")


def test_empty_event_logging(get_logs, keccak, get_contract):
loggy_code = """
Expand Down
3 changes: 0 additions & 3 deletions tests/functional/codegen/features/test_logging_from_call.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import pytest
from eth_utils import to_int

pytestmark = pytest.mark.usefixtures("memory_mocker")


def test_log_dynamic_static_combo(get_logs, get_contract):
code = """
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/codegen/features/test_packing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def test_packing_test(get_contract, memory_mocker):
def test_packing_test(get_contract):
packing_test = """
struct Bar:
a: int128
Expand Down
3 changes: 0 additions & 3 deletions tests/functional/codegen/features/test_reverting.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import pytest
from eth.codecs import abi

from vyper.utils import method_id

pytestmark = pytest.mark.usefixtures("memory_mocker")


def test_revert_reason(env, tx_failed, get_contract):
reverty_code = """
Expand Down
2 changes: 0 additions & 2 deletions tests/functional/codegen/types/test_string.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import pytest

pytestmark = pytest.mark.usefixtures("memory_mocker")


def test_string_return(get_contract):
code = """
Expand Down
6 changes: 0 additions & 6 deletions tests/functional/examples/conftest.py

This file was deleted.

2 changes: 0 additions & 2 deletions tests/functional/syntax/test_return_tuple.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
from vyper import compiler
from vyper.exceptions import FunctionDeclarationException

pytestmark = pytest.mark.usefixtures("memory_mocker")

fail_list = [
"""
@external
Expand Down

0 comments on commit 6c272b7

Please sign in to comment.