Skip to content

lion24/speed-sleuth

Repository files navigation

Speed Sleuth 🕵️ Tests codecov GH Page deploy

Automated speedtest analyser using selenium and a compatible browser.

Compatibility matrix

Operating System Chrome Firefox IE Safari Opera
Windows ⁉️ N/A
macOS
Linux N/A
  • ✅ - tested, works fine
  • ⚠️ - not for production use
  • ❔ - will work in the future (help out if you can)
  • ⁉️ - maybe works, not tested
  • ❌ no support planned

Supported provider

Provider Supported ?
Speedtest.net
Speedof.me
fast.com
Google Fiber Speed Test
TestMy.net
  • ✅ - tested, works fine
  • ❔ - will work in the future (help out if you can)

Focusing here on the top 5 most used providers. But other might be integrated. Feel free to add new ones.

Requirements

How to run

You can test against different providers:

hatch env run speed-sleuth -- <providers ...>

To test against speedtest.net:

hatch env run speed-sleuth -- speedtest

To test against multiple providers, for example speedtest.net and speedof.me (one test at a time)

hatch env run speed-sleuth -- speedtest speedofme

If running with hatch it's better to escape hatch arguments from the program arguments using --.

You can get help using:

hatch env run speed-sleuth -- --help

Some notes

Install editable dependencies: https://setuptools.pypa.io/en/latest/userguide/development_mode.html

hatch -e default shell
python -m pip install --editable .

Testing

I started to write a bunch of unit tests because running the full test suite using a real browser doing a real test is quite long and painful. The goal is the achieve the best coverage using unit tests.

If for any reason, one of the provider decide to change the design or the css class to activate the test, we are fucked.

That's why this is still important to run the integration tests against the real providers on a regular basis. For now this is not the case. The plan is to have a test that will be activate each night with a cron that will run the full integration test suite.

Some examples

Launch unit tests:

hatch run test:run -- -k unit

Launch the integration tests:

hatch run test:run -- -k integration

If you want to run the full test suite:

hatch run test:run

Note: be aware that running the full test suite requires a supported browser installed on your machine.

TODO

  • Add support for multiple browsers (see compatibility matrix).
  • Instead of taking pictures of the results, parse the DOM to retrieve results.
  • Achieve the best coverage possible.

Contributing

Hello fellow contributors!

First off, thank you for considering contributing to my awesome little project :-) Seeing new faces and fresh ideas is always appreciated. However, just like any well-maintained project, I've got a few guidelines to keep everything neat and tidy:

  • No tests, no entry: I love my tests just like a chef love its spices. So, if you're sending in a PR without tests, it's like serving a bland dish. I'll have to kindly ask you to spice it up or it will go straight to the reject pile. You can get some inspiration from the tests/unit and tests/integration folders.

  • Code, meet Documentation. Documentation, meet Code: Your code should come with its own documentation.

  • Expertise required: Just as I imagine you wouldn't trust your grandmother to perform heart surgery (no offense, Grandma), I would prefer that only experts edit the documentation. So unless proven, leave it to the pros.

  • Typos: The bane of every programmers' existence. While I appreciate your sense of observation, I've got automated typo correction software that's faster than you and me. So unless you have discovered a typo that reaches your sensibilities and causes havoc, I'll have to close those PRs faster than you can say "spellcheck."

  • Keep it "simple": If your PR looks "complex", is a big diff, changing a lot of stuff, it won't be review or merged. Consider breaking it into smaller PRs.

Don't go away! These guidelines aren't meant to scare you off – quite the opposite! I'm convinced this project can be very useful, so let's work together and make this project a nice tool for automation and network engineers (with documentation, of course).