question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add tests to check random drone generator (first-timers-only)

See original GitHub issue

first-timers-only

This issue is tagged :octocat: first-timers-only. It is only for people who have never contributed to open source before, and are looking for an easy way take their first steps.

Consider this your chance to dip your toe into the world of open-source, and get some bragging rights for writing code that makes drones fly, lets cars find charging stations, helps people and goods get from place to place, and more.

Find more first-timers-only issues here:

Thank you for your help ❤️

What is this project?

DAV (Decentralized Autonomous Vehicles) is a new foundation working to build an open-source infrastructure for autonomous vehicles (cars, drones, trucks, robots, and all the service providers around them) to communicate and transact with each other over blockchain.

As an organization that believes in building a large community of open-source contributors, we often create issues like this one to help people take their first few steps into the world of open source.

Mission Control

The DAV project you are looking at is Mission Control. It is the brain in charge of orchestrating missions between DAV users and autonomous vehicles.

How you can help

Background

To help developers building on top of DAV technologies, Mission Control can start in a simulation environment. In a simulation environment, there are always a few simulated drones flying around the user, ready to take on missions. This makes it easy for developers to start building and testing without investing in hardware.

The Issue

As a project that relies on a large community of contributors, it is very important for us to have good tests to make sure changes don’t break anything.

One of the functions that need testing is generateRandom() inside /server/simulation/drone.js that creates random simulated drones

Your task is to extend the test spec in test/specs/simulation.drone.spec.js to test the following condition:

  • it returns an object containing an id attribute.

Edit test/specs/simulation.drone.spec.js, adding a test that verifies the above condition.

To run your tests, run npm test from the project’s root directory. All tests should pass.

tests

Contributing to Mission Control

  • Make sure this issue is labeled up-for-grabs and not labeled claimed, to verify no one else is working on it.
  • Comment in this issue that you would like to do it.
  • Fork the repository from the Mission Control GitHub page.
  • Clone a copy to your local machine with $ git clone git@github.com:YOUR-GITHUB-USER-NAME/missioncontrol.git
  • Make sure you have node.js and npm installed on your machine. You can use this guide for help.
  • Install all of the project’s dependencies with npm. $ cd missioncontrol; npm install
  • Run npm test to run linting checks and all the automated tests and see that they pass.
  • Code! code! code!
  • Before committing your code, run npm test one last time and make sure no errors (including linting errors) are thrown.
  • Once you’ve made sure all your changes work correctly and committed all your changes, push your local changes back to github with $ git push -u origin master
  • Visit your fork on GitHub.com (https://github.com/YOUR-USER-NAME/missioncontrol) and create a pull request for your changes.
  • Make sure your pull request describes exactly what you changed and references this issue (include the issue number in the title like this: #27)
  • Please do not fix more than one issue at a time. Your pull request should only fix what is described in this issue.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
tm3cheuncommented, Sep 16, 2017

Hey @cg-cnu, I was running v6.9.1 so I updated to v8.4.0 and all the tests are passing! Thanks for your help!!

0reactions
TalAtercommented, Sep 16, 2017

Hi @ZackTaylor,

I created a followup issue just for you. If you’d like to take this one, please write so on #60.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Random data in Unit Tests? - Stack Overflow
"random values means the test isn't truly repeatable" not true, since the tets will be using pseudo-random numbers. Provide the same initial seed,...
Read more >
DroidbotX: Test Case Generation Tool for Android ... - MDPI
A Q-Learning-based test coverage approach developed in DroidbotX was proposed to generate GUI test cases for Android applications to maximize instruction ...
Read more >
SIG-Droid: Automated System Input Generation for Android ...
This paper presents SIG-Droid, a framework for system testing of Android apps, backed with automated ... certain integer, random input generation has only....
Read more >
How should I test randomness?
I don't think unit tests are the right tool for testing randomness. A unit test should call a method and test the returned...
Read more >
DROID Universal CV processor - MOD WIGGLER
Random / Pseudo random melody or trigger generator. Precision adder ... And/or, if only Droid could read i2c, I'd be immediately excited.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found