Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new Testing environment #890

Merged
merged 112 commits into from
Feb 13, 2024
Merged

new Testing environment #890

merged 112 commits into from
Feb 13, 2024

Conversation

shargon
Copy link
Member

@shargon shargon commented Feb 9, 2024

Part of #889
Require neo-project/neo#3134 #892

@shargon shargon mentioned this pull request Feb 9, 2024
6 tasks

The currently known limitations are:

- Receive events during the deploy, because the object is returned after performing the deploy, it is not possible to intercept notifications for the deploy unless the contract is previously created with `FromHash` knowing the hash of the contract to be created.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good to known.
Later, maybe we could create a function to facilitate with an example of a calculation of a hash and the track of this event.

@vncoelho
Copy link
Member

image

@shargon, updated devcontainer here to facilitate the verification of tests

.vscode/settings.json Outdated Show resolved Hide resolved
@vncoelho
Copy link
Member

@shargon,

Is the solution file correct?

Should not it be more clean, because everything from the submodule is being added there.

@cschuchardt88
Copy link
Member

cschuchardt88 commented Feb 12, 2024

neo-express has something you want to look at for testing contracts. It work very well. Currently still works and what i been using. It is written for the testing framework XUint. However still think the testing environment should plugin into a test framework. Either mstests or XUint, 100% not NUnit

https://github.com/neo-project/neo-express/tree/master/src/test-harness

@shargon
Copy link
Member Author

shargon commented Feb 12, 2024

neo-express has something you want to look at for testing contracts. It work very well. Currently still works and what i been using. It is written for the testing framework XUint. However still think the testing environment should plugin into a test framework. Either mstests or XUint, 100% not NUnit

https://github.com/neo-project/neo-express/tree/master/src/test-harness

I can take ideas about stacked invocations, thanks!

@cschuchardt88
Copy link
Member

cschuchardt88 commented Feb 12, 2024

stacked invocations

https://github.com/neo-project/neo-express/tree/master/src/assertions ?

Collecting Code Coverage Data - https://github.com/neo-project/neo-express/tree/master/src/collector? Could use this for contract code coverage

If any of that helps.

@shargon
Copy link
Member Author

shargon commented Feb 12, 2024

Collecting Code Coverage Data - https://github.com/neo-project/neo-express/tree/master/src/collector? Could use this for contract code coverage

If any of that helps.

I think it is feasible to calculate the coverage, and the NeoDebugInfo class can make it much easier for me, I will implement it in a next version :)

Copy link
Member

@cschuchardt88 cschuchardt88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really think you should look into a mocking framework like moq. However it looks good, could be great but a great start. After questions answered or no more changes I will approve.

EDIT:

Fix #890 (comment) or explain in document

@shargon
Copy link
Member Author

shargon commented Feb 13, 2024

@cschuchardt88 @Jim8y merge? I will improve it in a new PR (Gas cost per instruction and method)

@cschuchardt88
Copy link
Member

👍 💯
I'm good with it.

I'll be adding the .editorconfig from neo to this repo soon. But 1st i have to enforce the rules in neo.

@shargon shargon merged commit 022aed5 into master Feb 13, 2024
1 of 2 checks passed
@shargon shargon deleted the core-create-artifacts branch February 13, 2024 12:01
@shargon
Copy link
Member Author

shargon commented Feb 13, 2024

I need this merged to continue working on, Improvements can be incorporated in future pull requests.

Jim8y added a commit to Jim8y/neo-devpack-dotnet that referenced this pull request Feb 15, 2024
* master:
  [Framework Add] predefine manifest (neo-project#903)
  TestEngine: Get instruction coverage and move to net standard (neo-project#898)
  remove disable PublishToGithub (neo-project#901)
  Added `publish` to `github packages` and fix submodules (neo-project#899)
  bug: Fix default value when Stored (neo-project#895)
  Modify changelog during release (neo-project#900)
  Fixed `PackageReference` for `neo` (neo-project#897)
  cancel optimization on exception
  fix catch
  new Testing environment (neo-project#890)
  Updated submodule neo (neo-project#892)
  Update and fix Nep17 template (neo-project#891)
Copy link
Member

@vncoelho vncoelho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finished reviewing today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants