Skip to content

Isolate unit tests#3904

Merged
shargon merged 6 commits intomasterfrom
isolate-ut
Apr 17, 2025
Merged

Isolate unit tests#3904
shargon merged 6 commits intomasterfrom
isolate-ut

Conversation

@shargon
Copy link
Member

@shargon shargon commented Apr 17, 2025

Description

I have isolated the unit tests by eliminating the static variable from neo system and forcing a new one to be instantiated per unit test.

Fix #3903 and #3874

Type of change

  • Optimization (the change is only an optimization)
  • Style (the change is only a code style for better maintenance or standard purpose)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • All tests changed

Test Configuration:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@shargon shargon requested a review from Jim8y April 17, 2025 10:52
@shargon shargon added Bug Used to tag confirmed bugs Waiting for Review labels Apr 17, 2025
@shargon shargon mentioned this pull request Apr 17, 2025
15 tasks
@shargon shargon mentioned this pull request Apr 17, 2025
15 tasks
@shargon
Copy link
Member Author

shargon commented Apr 17, 2025

@neo-project/core probably this will eliminate some random errors that we get with unit tests

@shargon shargon merged commit 883de97 into master Apr 17, 2025
6 of 7 checks passed
@shargon shargon deleted the isolate-ut branch April 17, 2025 14:37
Jim8y added a commit to Jim8y/neo that referenced this pull request Apr 17, 2025
* master:
  DBFTPlugin: include consensus time into block interval (neo-project#3900)
  Isolate unit tests (neo-project#3904)
  Use DateTime.UtcNow (neo-project#3902)
  Update workflow (neo-project#3901)
  optimize: show state more readable (neo-project#3899)
  Optimize KeyedCollectionSlim (neo-project#3877)
  Native: move MillisecondsPerBlock setting to native Policy (neo-project#3895)
  optimize: history command support (neo-project#3892)
  Ensure that view interops can't be changed outside (neo-project#3812)
cschuchardt88 pushed a commit to cschuchardt88/neo that referenced this pull request Jun 8, 2025
* Isolate unit tests

* Update tests/Neo.UnitTests/SmartContract/Native/UT_PolicyContract.cs

* clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants