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

test(backend): add Rust tests #104

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft

test(backend): add Rust tests #104

wants to merge 22 commits into from

Conversation

ravenclaw900
Copy link
Owner

@ravenclaw900 ravenclaw900 commented Dec 31, 2021

Sadly, since we can't make any assumptions about the computer DietPi is running on, most of these tests will have to be incredibly basic, and some of them won't even run on the GitHub Actions Ubuntu VM.

  • Add tests for round_percent
  • Add tests for cpu
  • Add tests for ram
  • Add tests for swap
  • Add tests for disk
  • Add tests for network
  • Add tests for processes
  • Add tests for dpsoftware
  • Add tests for host
  • Add tests for services
  • Add tests for browser_handler (Test all functions of file browser)
  • Add tests for file_handler
  • Add tests for term_handler
  • Add tests for config

@ravenclaw900 ravenclaw900 added enhancement New feature or request rust Pull requests that update Rust code labels Dec 31, 2021
@ravenclaw900 ravenclaw900 deleted the tests branch March 20, 2022 22:30
@ravenclaw900 ravenclaw900 restored the tests branch March 20, 2022 22:32
@ravenclaw900 ravenclaw900 reopened this Mar 20, 2022
@ravenclaw900 ravenclaw900 marked this pull request as draft May 21, 2022 22:27
@MichaIng
Copy link
Collaborator

Is there any issue merging the tests which are there now? No need to implement all of them in a single PR IMO. Could be also done on demand when a certain bug was found or certain page/feature code touched anyway.

@ravenclaw900
Copy link
Owner Author

A few of them still use Warp, which would be a problem. But I could probably fix them up and merge them soon (though I'd probably scrap them and start again actually, too much has changed). The problem is that it's really hard to test functions that return things like CPU percentage, which is in no way fixed. The only thing I've found to do is bounds checking and making sure the function doesn't panic.

Signed-off-by: MichaIng <micha@dietpi.com>
@MichaIng
Copy link
Collaborator

MichaIng commented Mar 18, 2023

I just resolved conflicts with main, hopefully didn't break something, but since it was really the tests at the bottom of scripts + tempfile dependency only, pretty clean.

use warp::Filter;

I see, so they need to be updated 😉.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants