diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 55067189b8df8485663f032211f0910b1f47157b..9b4ac1832a6b00e6dc66b0282796df7646767ea7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,10 +11,10 @@ stages: build_job: stage: build script: - - bash ci-build.sh + - bash ci/ci-build.sh # run tests using the binary built before test_job: stage: test script: - - bash ci-test.sh + - bash ci/ci-test.sh diff --git a/.gitlab/issue_templates/bug.md b/.gitlab/issue_templates/bug.md new file mode 100644 index 0000000000000000000000000000000000000000..2d3657bef856156d171c856dc475b6c661a81b4e --- /dev/null +++ b/.gitlab/issue_templates/bug.md @@ -0,0 +1,8 @@ +## Bug Description +*Describe the bug* + +### Steps to reproduce +1. + +## Proposed Fix +*Describe the proposed fix for the bug* diff --git a/.gitlab/issue_templates/cleanup.md b/.gitlab/issue_templates/cleanup.md new file mode 100644 index 0000000000000000000000000000000000000000..68728f173ca775b0280552cfe38b4ff43f7cdbc6 --- /dev/null +++ b/.gitlab/issue_templates/cleanup.md @@ -0,0 +1,5 @@ +## Problem Description +*Describe the area needing improvement or clean up* + +## Proposed Solution +*Describe the proposed solution* diff --git a/.gitlab/issue_templates/feature.md b/.gitlab/issue_templates/feature.md new file mode 100644 index 0000000000000000000000000000000000000000..d740a95b56657c2a5f7d81d2a619191b5e8d8ec8 --- /dev/null +++ b/.gitlab/issue_templates/feature.md @@ -0,0 +1,5 @@ +## Problem Description +*Describe the problem or idea* + +## Proposed Solution +*Describe the proposed solution to the problem* diff --git a/.gitlab/merge_request_templates/bug.md b/.gitlab/merge_request_templates/bug.md new file mode 100644 index 0000000000000000000000000000000000000000..98694b70ba9dfdc60abce83203b9e68f4cd202a8 --- /dev/null +++ b/.gitlab/merge_request_templates/bug.md @@ -0,0 +1,12 @@ +## Bug Description +*Describe the bug* + +## Fix Description +*Describe your implemented fix* + +## Impacted Areas +*Remove inapplicable items* +- Quad Software +- Controls +- Ground Station +- Testing diff --git a/.gitlab/merge_request_templates/cleanup.md b/.gitlab/merge_request_templates/cleanup.md new file mode 100644 index 0000000000000000000000000000000000000000..c4184d3fb300121695d7ac7398b0950488a5ba90 --- /dev/null +++ b/.gitlab/merge_request_templates/cleanup.md @@ -0,0 +1,11 @@ +## Problem Description +*Describe the problem you addressed with the clean up* + +## Refactor Description +*Describe your clean up efforts* + +## Clean up areas +*Remove inapplicable items* +- Code refactor +- Code comments added +- Documentation added diff --git a/.gitlab/merge_request_templates/feature.md b/.gitlab/merge_request_templates/feature.md new file mode 100644 index 0000000000000000000000000000000000000000..11346e1e297031f35e471d170f8d5be491d1e0df --- /dev/null +++ b/.gitlab/merge_request_templates/feature.md @@ -0,0 +1,12 @@ +## Feature Description +*Describe the feature* + +## Implementation Details +*Describe your implementation* + +## Impacted Areas +*Remove inapplicable items* +- Quad Software +- Controls +- Ground Station +- Testing diff --git a/README.md b/README.md index d10e413b3f059613e219b3704aa4efb151cee152..30f7f10b86d95a951e1f1231d346f517802e9d38 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[](https://git.ece.iastate.edu/danc/MicroCART_17-18/commits/master) +[](https://git.ece.iastate.edu/danc/MicroCART/commits/master) # MicroCART @@ -25,17 +25,18 @@ MicroCART has 3 areas of development: effective characterization of the quad. ## Sections -[Quadcopter](quad/README.md) -[Ground Station](groundStation/README.md) -[Controls](controls/README.md) +- [Quadcopter](quad/README.md) +- [Ground Station](groundStation/README.md) +- [Controls](controls/README.md) ## Documentation -[How to demo the quadcopter](documentation/how_to_demo.md) -[How to charge the LiPo batteries](documentation/how_to_charge_lipo.md) -[Continuous Integration FAQ](documentation/ci_faq.md) -[How to document things on Gitlab](documentation/how_to_document_things_on_gitlab.md) -[How to update the website](website/README.md) -[How to use Git](documentation/how_to_use_git.md) +- [Getting started](documentation/getting_started.md) +- [How to demo the quadcopter](documentation/how_to_demo.md) +- [How to charge the LiPo batteries](documentation/how_to_charge_lipo.md) +- [Continuous Integration FAQ](documentation/ci_faq.md) +- [How to document things on Gitlab](documentation/how_to_document_things_on_gitlab.md) +- [How to update the website](website/README.md) +- [How to use Git](documentation/how_to_use_git.md) # Stable Releases To browse stable releases from previous teams, view the [Tags](/../tags). diff --git a/ci/README.md b/ci/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3a358d1ecc490882f7c11244c2a365e48b1d27dd --- /dev/null +++ b/ci/README.md @@ -0,0 +1,12 @@ +# What's here? +This folder contains the scripts run by the CI pipeline on GitLab. +The [`.gitlab-ci.yml`](.gitlab-ci.yml) at the top level of the repo +specifies the two stages of the pipeline, __Build__ and __Test__. + +## Build Stage +The build stage is defined by the [`ci-build.sh`](ci/ci-build.sh) file. +It runs [make](quad/Makefile) under the quad directory to build the project. + +## Test Stage +The test stage is defined by the [`ci-test.sh`](ci/ci-test.sh) file. +It runs [make test](quad/Makefile#36) under the quad directory to run the tests. diff --git a/ci-build.sh b/ci/ci-build.sh similarity index 100% rename from ci-build.sh rename to ci/ci-build.sh diff --git a/ci-test.sh b/ci/ci-test.sh similarity index 100% rename from ci-test.sh rename to ci/ci-test.sh diff --git a/documentation/ci_faq.md b/documentation/ci_faq.md index d083d62ef37cb6e7d9653eebd21aa1d9387e3bfb..a4112108bead2c9582d26b14d3c4fdb3eb74274d 100644 --- a/documentation/ci_faq.md +++ b/documentation/ci_faq.md @@ -36,10 +36,10 @@ directory. ## How does CI work? When a commit is added to a branch in our repository, a notification is sent out to our gitlab-ci-runner, which instructs it to checkout the updated branch and -run the directive in `.gitlab-ci.yml`. It then runs each directive, which is +run the directive in [`.gitlab-ci.yml`](.gitlab-ci.yml). It then runs each directive, which is made up of bash scripts to execute. In our case, we run two scripts, -`ci-build.sh` and `ci-test.sh`, which compile projects and run checks, -respectively. (Look at these scripts to learn more about how they work). If -some error occurs during the script (perhaps a forced error generated by a -failed test), then the runner sends a message back to Gitlab indicating that the -CI failed. Otherwise, it succeeds. +[`ci-build.sh`](ci/ci-build.sh) and [`ci-test.sh`](ci/ci-test.sh), +which compile projects and run checks, respectively. Look at these scripts to +learn more about how they work. If some error occurs during the script +(perhaps a forced error generated by a failed test), then the runner sends a +message back to Gitlab indicating that the CI failed. Otherwise, it succeeds. diff --git a/quad/Makefile b/quad/Makefile index cfe2afd6e1c1285508e8ee6c5205539a9fc5bcf0..637111f59ecbdd2d28f81804d9f573dfe55508b1 100644 --- a/quad/Makefile +++ b/quad/Makefile @@ -38,9 +38,9 @@ test: all $(MAKE) -C src/queue test $(MAKE) -C src/computation_graph test $(MAKE) -C src/quad_app test - ruby scripts/tests/test_memory_integrity.rb - ruby scripts/tests/test_safety_checks.rb - ruby scripts/tests/test_communication.rb + ruby scripts/ci-tests/test_memory_integrity.rb + ruby scripts/ci-tests/test_safety_checks.rb + ruby scripts/ci-tests/test_communication.rb clean: rm -rf $(INCDIR) $(LIBDIR) $(OUTDIR) $(EXEDIR) diff --git a/quad/scripts/tests/test_communication.rb b/quad/scripts/ci-tests/test_communication.rb similarity index 100% rename from quad/scripts/tests/test_communication.rb rename to quad/scripts/ci-tests/test_communication.rb diff --git a/quad/scripts/tests/test_memory_integrity.rb b/quad/scripts/ci-tests/test_memory_integrity.rb similarity index 97% rename from quad/scripts/tests/test_memory_integrity.rb rename to quad/scripts/ci-tests/test_memory_integrity.rb index 87cbc83b8795758275fdc63d682857f7bdd4f97d..45382f69617a0d32385fb942cc6efc71d698682b 100644 --- a/quad/scripts/tests/test_memory_integrity.rb +++ b/quad/scripts/ci-tests/test_memory_integrity.rb @@ -77,7 +77,7 @@ ensure Process.kill(2, quad) sleep 1 # wait for valgrind to write to file - # Process the valgrind file + # Process the valgrind file, look for number of errors file = File.open("./valgrind.out") everything = file.readlines last_line = everything.last diff --git a/quad/scripts/tests/test_safety_checks.rb b/quad/scripts/ci-tests/test_safety_checks.rb similarity index 93% rename from quad/scripts/tests/test_safety_checks.rb rename to quad/scripts/ci-tests/test_safety_checks.rb index c96a8228f66cde705e62e81ab992eabd803c2569..9350c7fc2c27cb3c0e60d57b5b714c8fadd33559 100644 --- a/quad/scripts/tests/test_safety_checks.rb +++ b/quad/scripts/ci-tests/test_safety_checks.rb @@ -51,7 +51,7 @@ Timeout::timeout(60) { check_led(0, "LED was on at startup! It should be off so that we can verify when the quad is ready.") puts("Check that increasing the throttle does nothing to motors") - # (because gear is still off) + # Motors should not engage when gear is still off for i in (THROTTLE_MIN..THROTTLE_MAX).step(0.01) set_throttle(i) check_motors_are_off "Was able to turn on motors with GEAR off! Yikes!" @@ -60,7 +60,8 @@ Timeout::timeout(60) { end puts("Check that flipping gear to 1 while throttle is high does nothing") - # (motors should still be off, LED should still be off) + # Motors should still be off, LED should still be off + set_gear GEAR_ON sleep 0.01 check_motors_are_off "Motors turned on by gear while rc throttle was high! How dangerous!" i = THROTTLE_MAX @@ -72,12 +73,12 @@ Timeout::timeout(60) { sleep 0.005 end - # (swtich GEAR back to off and bring throttle off) + # Switch GEAR off and bring throttle off set_gear GEAR_OFF set_throttle THROTTLE_MIN puts("Check that the LED turns on when gear is flipped on") - # (motors should still be off because our throttle is low) + # Motors should still be off because our throttle is low set_gear GEAR_ON sleep 0.01 check_motors_are_off "Motors turned on while throttle was low! Yikes!" @@ -129,7 +130,7 @@ Timeout::timeout(60) { sleep 0.01 check_motors_are_off "Motors didn't turn off when GEAR was switched off! How dangerous!" - # (Bring the RC throttle back down) + # Bring the RC throttle back to minimum set_throttle THROTTLE_MIN puts "All safety checks passed." diff --git a/quad/scripts/tests/testing_library.rb b/quad/scripts/ci-tests/testing_library.rb similarity index 100% rename from quad/scripts/tests/testing_library.rb rename to quad/scripts/ci-tests/testing_library.rb diff --git a/quad/scripts/tests/run_virtual_test_flight.rb b/quad/scripts/inactive-tests/run_virtual_test_flight.rb similarity index 100% rename from quad/scripts/tests/run_virtual_test_flight.rb rename to quad/scripts/inactive-tests/run_virtual_test_flight.rb diff --git a/quad/scripts/tests/tcp_stress_tests.py b/quad/scripts/inactive-tests/tcp_stress_tests.py similarity index 100% rename from quad/scripts/tests/tcp_stress_tests.py rename to quad/scripts/inactive-tests/tcp_stress_tests.py diff --git a/quad/scripts/tests/test_logging.rb b/quad/scripts/inactive-tests/test_logging.rb similarity index 100% rename from quad/scripts/tests/test_logging.rb rename to quad/scripts/inactive-tests/test_logging.rb diff --git a/quad/scripts/tests/test_uart_comm.py b/quad/scripts/inactive-tests/test_uart_comm.py similarity index 100% rename from quad/scripts/tests/test_uart_comm.py rename to quad/scripts/inactive-tests/test_uart_comm.py diff --git a/quad/scripts/tests/test_zybo_uart.py b/quad/scripts/inactive-tests/test_zybo_uart.py similarity index 100% rename from quad/scripts/tests/test_zybo_uart.py rename to quad/scripts/inactive-tests/test_zybo_uart.py diff --git a/quad/scripts/tests/uart_stress_tests.py b/quad/scripts/inactive-tests/uart_stress_tests.py similarity index 100% rename from quad/scripts/tests/uart_stress_tests.py rename to quad/scripts/inactive-tests/uart_stress_tests.py