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

Added functional tests for getmemoryinfo, getrpcinfo, uptime #340

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

qlrd
Copy link
Contributor

@qlrd qlrd commented Jan 13, 2025

What is the purpose of this pull request?

  • Bug fix
  • New feature
  • Docs update
  • Tests

Summary

Added functional tests for floresta-cli commands:

  • getmemoryinfo

  • getrpcinfo

  • uptime

@qlrd
Copy link
Contributor Author

qlrd commented Jan 13, 2025

Test issues:

  • getmemoryinfo:
# Local test
# "Poe => python tests/run_tests.py --test-name floresta_cli_getmemoryinfo" the result was
{'id': '0', 'result': {'locked': {'chunks_free': 0, 'chunks_used': 0, 'free': 0, 'locked': 0, 'total': 0, 'used': 0}}}

# Github-Action test
# "Poe => python tests/run_tests.py --test-name floresta_cli_getmemoryinfo" the result was
{'locked': {'chunks_free': 0, 'chunks_used': 28, 'free': 1629712, 'locked': 29036544, 'total': 9101312, 'used': 7471600}}}
  • getrpcinfo:

When executed (locally):

assert result["logpath"] == os.path.normpath(
  os.path.join(
    GetRpcInfoTest.data_dir,
      "regtest",
      "output.log"
    )
)

The result["logpath"] was /tmp/floresta-func-tests/florestacli-getrpcinfo-test/node-0/regtest//output.log (with double //).

@Davidson-Souza
Copy link
Collaborator

The result["logpath"] was /tmp/floresta-func-tests/florestacli-getrpcinfo-test/node-0/regtest//output.log (with double //).

Oh, shoot! I think you found a bug!

For the first one, those stats only works if you build for a gnu system (it's the same for core). Just check the target triple to see if it ends with -gnu. Mine is x86_64-unknown-linux-gnu.

@qlrd
Copy link
Contributor Author

qlrd commented Jan 14, 2025

The result["logpath"] was /tmp/floresta-func-tests/florestacli-getrpcinfo-test/node-0/regtest//output.log (with double //).

Oh, shoot! I think you found a bug!

Ok, i will fix the code to keep it regtest/output.log

For the first one, those stats only works if you build for a gnu system (it's the same for core). Just check the target triple to see if it ends with -gnu. Mine is x86_64-unknown-linux-gnu.

Tested on a mac, so it make sense now why the values are zero. I will re-do tests on linux.

@qlrd
Copy link
Contributor Author

qlrd commented Jan 15, 2025

For the first one, those stats only works if you build for a gnu system (it's the same for core). Just check the target triple to see if it ends with -gnu. Mine is x86_64-unknown-linux-gnu.

Checked and fixed. Only the // stuff wasn't changed

@Davidson-Souza
Copy link
Collaborator

Do you want to fix this too? I think you just need to remove the backslash from this line

data_dir.clone() + "/output.log",

@qlrd
Copy link
Contributor Author

qlrd commented Jan 17, 2025

Do you want to fix this too? I think you just need to remove the backslash from this line

data_dir.clone() + "/output.log",

Will fix (i was trying to find it).

* getmemoryinfo (linux only)

* getrpcinfo

* uptime

fix: florestad getrpcinfo command and florestad binary on tests

* florestad/src/florestad.rs: bug fix on start method when send 'logpath' from 'floresta-cli getrpcinfo' command;

fix: check for florestad binaries

* search for binaries in /tmp/floresta-integration-tests or ./target/release

* tests/test_framework/test_framework: added full path of 'florestad' binary to avoid break tests
@Davidson-Souza Davidson-Souza merged commit a6768ac into vinteumorg:master Jan 21, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants