Skip to content

Commit f54ba61

Browse files
authored
test(spec): move spec test runners to test folder (#699)
1 parent 84a83a7 commit f54ba61

27 files changed

+7
-5
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ $(VECTORS_DIR)/%: $(SPECTEST_ROOTDIR)/%_${SPECTEST_VERSION}.tar.gz
160160
-rm -rf $@
161161
tar -xzmf "$<" -C $(SPECTEST_ROOTDIR)
162162

163-
$(SPECTEST_GENERATED_ROOTDIR): $(VECTORS_DIR)/mainnet $(VECTORS_DIR)/minimal $(VECTORS_DIR)/general lib/spec/runners/*.ex lib/mix/tasks/generate_spec_tests.ex
163+
$(SPECTEST_GENERATED_ROOTDIR): $(VECTORS_DIR)/mainnet $(VECTORS_DIR)/minimal $(VECTORS_DIR)/general test/spec/runners/*.ex test/spec/tasks/*.ex
164164
mix generate_spec_tests
165165

166166
#⬇️ download-vectors: @ Download the spec test vectors files.

lib/lambda_ethereum_consensus/p2p/block_downloader.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ defmodule LambdaEthereumConsensus.P2P.BlockDownloader do
5050
{:ok, chunks} <- parse_response(response_chunk),
5151
{:ok, blocks} <- decode_chunks(chunks),
5252
:ok <- verify_batch(blocks, slot, count) do
53-
# TODO: handle cases where slot is empty
5453
tags = %{result: "success", type: "by_slot", reason: "success"}
5554
:telemetry.execute([:network, :request], %{blocks: count}, tags)
5655
{:ok, blocks}

mix.exs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ defmodule LambdaEthereumConsensus.MixProject do
1212
elixirc_paths: compiler_paths(Mix.env()),
1313
warn_test_pattern: "_remove_warning.exs",
1414
preferred_cli_env: [
15-
dialyzer: :test
15+
dialyzer: :test,
16+
generate_spec_tests: :test
1617
]
1718
]
1819
end
@@ -69,6 +70,8 @@ defmodule LambdaEthereumConsensus.MixProject do
6970
]
7071
end
7172

72-
defp compiler_paths(:test), do: ["test/spec", "test/fixtures"] ++ compiler_paths(:prod)
73+
defp compiler_paths(:test),
74+
do: ["test/spec", "test/fixtures"] ++ compiler_paths(:prod)
75+
7376
defp compiler_paths(_), do: ["lib", "proto"]
7477
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

lib/mix/tasks/generate_spec_tests.ex renamed to test/spec/tasks/generate_spec_tests.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ defmodule Mix.Tasks.GenerateSpecTests do
1616
@shortdoc "Generates tests for spec test files"
1717
@impl Mix.Task
1818
def run(_args) do
19-
{:ok, file_names} = File.ls(Path.join(["lib", "spec", "runners"]))
19+
{:ok, file_names} = File.ls(Path.join(["test", "spec", "runners"]))
2020
runners = Enum.map(file_names, &Path.basename(&1, ".ex"))
2121

2222
# Generate all tests for Capella fork
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)