Skip to content

Commit

Permalink
Update and fix ethereum tests (#3778)
Browse files Browse the repository at this point in the history
* updated tests

* update tests reference to the most recent commit

* update tests reference

* fix loaders

* delete stale tests

* update tests

* fix BerlinToLondon tests

* ignore 12 transactions tests for now (passing hive tests, failing here)

* update TransactionTests runner

* disable difficulty tests with broken loader

* move VM tests from Blockchain.Test project to VM.Test project

* clean

* fix workflow and add missing tests

* remove duplicated tests

* fix MetaTest

* add MetaTest for VM.Test

* cosmetics

* suggested changes
  • Loading branch information
marcindsobczak authored and parinayc20 committed Feb 9, 2022
1 parent 930dd78 commit 811ecae
Show file tree
Hide file tree
Showing 60 changed files with 262 additions and 1,447 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/run-nethermind-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,10 @@ jobs:
dotnet test -c Release src/Nethermind/Ethereum.KeyAddress.Test
- name: Ethereum.PoW.Test
run: |
dotnet test -c Release src/Nethermind/Ethereum.Rlp.Test
dotnet test -c Release src/Nethermind/Ethereum.PoW.Test
- name: Ethereum.Rlp.Test
run: |
dotnet test -c Release src/Nethermind/Ethereum.Basic.Test
dotnet test -c Release src/Nethermind/Ethereum.Rlp.Test
- name: Ethereum.Transaction.Test
run: |
dotnet test -c Release src/Nethermind/Ethereum.Transaction.Test
Expand All @@ -280,3 +280,6 @@ jobs:
- name: Ethereum.Trie.Test
run: |
dotnet test -c Release src/Nethermind/Ethereum.Trie.Test
- name: Ethereum.VM.Test
run: |
dotnet test -c Release src/Nethermind/Ethereum.VM.Test
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@
<Link>%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="..\..\tests\BlockchainTests\ValidBlocks\VMTests\vm*\*.*">
<Content Include="..\..\tests\BlockchainTests\InvalidBlocks\bc*\*.*">
<Link>%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<!-- <Content Include="..\..\tests\BlockchainTests\InvalidBlocks\bc*\*.*">-->
<!-- <Link>InvalidBlocks\%(RecursiveDir)%(FileName)%(Extension)</Link>-->
<!-- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>-->
<!-- </Content>-->
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Ethereum.Test.Base\Ethereum.Test.Base.csproj" />
Expand Down
11 changes: 6 additions & 5 deletions src/Nethermind/Ethereum.Blockchain.Block.Test/ExampleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,22 @@
*/

using System.Collections.Generic;
using System.Threading.Tasks;
using Ethereum.Test.Base;
using NUnit.Framework;

namespace Ethereum.Blockchain.Block.Test
{
[TestFixture][Parallelizable(ParallelScope.All)]
public class ExampleTests : GeneralStateTestBase
public class ExampleTests : BlockchainTestBase
{
[TestCaseSource(nameof(LoadTests))]
public void Test(GeneralStateTest test)
public async Task Test(BlockchainTest test)
{
Assert.True(RunTest(test).Pass);
await RunTest(test);
}

public static IEnumerable<GeneralStateTest> LoadTests() { var loader = new TestsSourceLoader(new LoadGeneralStateTestsStrategy(), "bcExample");
return (IEnumerable<GeneralStateTest>)loader.LoadTests(); }
public static IEnumerable<BlockchainTest> LoadTests() { var loader = new TestsSourceLoader(new LoadBlockchainTestsStrategy(), "bcExample");
return (IEnumerable<BlockchainTest>)loader.LoadTests(); }
}
}
2 changes: 1 addition & 1 deletion src/Nethermind/Ethereum.Blockchain.Block.Test/MetaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void All_categories_are_tested()
string[] directories =
Directory.GetDirectories(AppDomain.CurrentDomain.BaseDirectory)
.Select(Path.GetFileName)
.Where(d =>d.StartsWith("bc") || d.StartsWith("vm"))
.Where(d =>d.StartsWith("bc"))
.ToArray();

Type[] types = GetType().Assembly.GetTypes();
Expand Down
42 changes: 0 additions & 42 deletions src/Nethermind/Ethereum.Blockchain.Block.Test/VmArithmeticTests.cs

This file was deleted.

This file was deleted.

42 changes: 0 additions & 42 deletions src/Nethermind/Ethereum.Blockchain.Block.Test/VmBlockInfoTests.cs

This file was deleted.

This file was deleted.

This file was deleted.

42 changes: 0 additions & 42 deletions src/Nethermind/Ethereum.Blockchain.Block.Test/VmLogTest.cs

This file was deleted.

This file was deleted.

Loading

0 comments on commit 811ecae

Please sign in to comment.