rooch-network / rooch

VApp Container with Move Language
https://rooch.network
Apache License 2.0
128 stars 54 forks source link

[exp] file formats #346

Closed feliciss closed 10 months ago

feliciss commented 10 months ago

When generating exp files, there are automated formats generated from the test runner. However, issues remain at alarming level especially mishandled with "Enter" or "White Space" at the end of the exp files.

For example:

  1. This test would succeed with a new line at the EOF:
processed 2 tasks

task 1 'publish'. lines 3-13:
status EXECUTED
  1. This test wouldn't:
processed 2 tasks

task 1 'publish'. lines 3-13:
status EXECUTED

Similarly:

  1. Successful:
processed 2 tasks

task 1 'publish'. lines 3-7:
Error: error: type name "T2" not defined in function "create_box"
  ┌─ /tmp/tempfile:6:5
  │
6 │     public fun create_box<T1>() {}
  │     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1. Failure:
processed 2 tasks

task 1 'publish'. lines 3-7:
Error: error: type name "T2" not defined in function "create_box"
  ┌─ /tmp/tempfile:6:5
  │
6 │     public fun create_box<T1>() {}
  │     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Due to the absence of exp formatter, I suggest we compile a one and submit a request to https://github.com/move-language/move.

Ref: https://github.com/move-language/move/issues/166

jolestar commented 10 months ago

So, the solution is to trim the end new line and white space? The exp file is auto generate by the test, so developers should rarely encounter this issue.

feliciss commented 10 months ago

So, the solution is to trim the end new line and white space? The exp file is auto generate by the test, so developers should rarely encounter this issue.

Not really. Only rooch move integration-test command will generate exp files. Other exp files, such those in the rooch-framework-tests and rooch-integration-test-runner are run by the command cargo test.

And yes, based on the above assumptions, examples for developers will cause no problems because the exp files are generated from rooch move command and thus end-users and -developers friendly.

Also no. We, rooch developers will have to handle trimming new lines and white spaces for exp files that run by cargo in the crates directory.

jolestar commented 10 months ago

Set env UB=1 to generate the exp file.

UB=1 cargo test

We need a document to describe how to write integration tests.

feliciss commented 10 months ago

Set env UB=1 to generate the exp file.

UB=1 cargo test

We need a document to describe how to write integration tests.

I set it before, but it seemed it didn't work.

I reran with UB=1 cargo test -p testsuite --test integration and UB=1 cargo test --package rooch-framework-tests --test tests. It still didn't work.

Ok.. I retested and I could generate it with UB=1 cargo test in the exact directory.

feliciss commented 10 months ago

Something notable:

test panicked: called `Result::unwrap()` on an `Err` value: Custom { kind: Uncategorized, error: PathError { path: "/var/folders/30/bf9thrdx4q58bzsk7xg3sbtw0000gn/T/.tmpQw9MUJ", err: Os { code: 24, kind: Uncategorized, message: "Too many open files" } } }

When running it in local command line environment.

jolestar commented 10 months ago

setting the os config