Skip to content
Snippets Groups Projects
Commit a75dfeff authored by Peter Thedens's avatar Peter Thedens
Browse files

Merge branch 'master' into TESTING_unit_testing_upgrade

parents a0181ded 8164fb57
No related branches found
No related tags found
No related merge requests found
Showing
with 94 additions and 27 deletions
...@@ -11,10 +11,10 @@ stages: ...@@ -11,10 +11,10 @@ stages:
build_job: build_job:
stage: build stage: build
script: script:
- bash ci-build.sh - bash ci/ci-build.sh
# run tests using the binary built before # run tests using the binary built before
test_job: test_job:
stage: test stage: test
script: script:
- bash ci-test.sh - bash ci/ci-test.sh
## Bug Description
*Describe the bug*
### Steps to reproduce
1.
## Proposed Fix
*Describe the proposed fix for the bug*
## Problem Description
*Describe the area needing improvement or clean up*
## Proposed Solution
*Describe the proposed solution*
## Problem Description
*Describe the problem or idea*
## Proposed Solution
*Describe the proposed solution to the problem*
## Bug Description
*Describe the bug*
## Fix Description
*Describe your implemented fix*
## Impacted Areas
*Remove inapplicable items*
- Quad Software
- Controls
- Ground Station
- Testing
## 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
## Feature Description
*Describe the feature*
## Implementation Details
*Describe your implementation*
## Impacted Areas
*Remove inapplicable items*
- Quad Software
- Controls
- Ground Station
- Testing
[![build status](https://git.ece.iastate.edu/danc/MicroCART/badges/master/build.svg)](https://git.ece.iastate.edu/danc/MicroCART_17-18/commits/master) [![build status](https://git.ece.iastate.edu/danc/MicroCART/badges/master/build.svg)](https://git.ece.iastate.edu/danc/MicroCART/commits/master)
# MicroCART # MicroCART
...@@ -25,17 +25,18 @@ MicroCART has 3 areas of development: ...@@ -25,17 +25,18 @@ MicroCART has 3 areas of development:
effective characterization of the quad. effective characterization of the quad.
## Sections ## Sections
[Quadcopter](quad/README.md) - [Quadcopter](quad/README.md)
[Ground Station](groundStation/README.md) - [Ground Station](groundStation/README.md)
[Controls](controls/README.md) - [Controls](controls/README.md)
## Documentation ## Documentation
[How to demo the quadcopter](documentation/how_to_demo.md) - [Getting started](documentation/getting_started.md)
[How to charge the LiPo batteries](documentation/how_to_charge_lipo.md) - [How to demo the quadcopter](documentation/how_to_demo.md)
[Continuous Integration FAQ](documentation/ci_faq.md) - [How to charge the LiPo batteries](documentation/how_to_charge_lipo.md)
[How to document things on Gitlab](documentation/how_to_document_things_on_gitlab.md) - [Continuous Integration FAQ](documentation/ci_faq.md)
[How to update the website](website/README.md) - [How to document things on Gitlab](documentation/how_to_document_things_on_gitlab.md)
[How to use Git](documentation/how_to_use_git.md) - [How to update the website](website/README.md)
- [How to use Git](documentation/how_to_use_git.md)
# Stable Releases # Stable Releases
To browse stable releases from previous teams, view the [Tags](/../tags). To browse stable releases from previous teams, view the [Tags](/../tags).
# 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.
File moved
File moved
...@@ -36,10 +36,10 @@ directory. ...@@ -36,10 +36,10 @@ directory.
## How does CI work? ## How does CI work?
When a commit is added to a branch in our repository, a notification is sent out 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 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, 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, [`ci-build.sh`](ci/ci-build.sh) and [`ci-test.sh`](ci/ci-test.sh),
respectively. (Look at these scripts to learn more about how they work). If which compile projects and run checks, respectively. Look at these scripts to
some error occurs during the script (perhaps a forced error generated by a learn more about how they work. If some error occurs during the script
failed test), then the runner sends a message back to Gitlab indicating that the (perhaps a forced error generated by a failed test), then the runner sends a
CI failed. Otherwise, it succeeds. message back to Gitlab indicating that the CI failed. Otherwise, it succeeds.
...@@ -38,9 +38,9 @@ test: all ...@@ -38,9 +38,9 @@ test: all
$(MAKE) -C src/queue test $(MAKE) -C src/queue test
$(MAKE) -C src/computation_graph test $(MAKE) -C src/computation_graph test
$(MAKE) -C src/quad_app test $(MAKE) -C src/quad_app test
ruby scripts/tests/test_memory_integrity.rb ruby scripts/ci-tests/test_memory_integrity.rb
ruby scripts/tests/test_safety_checks.rb ruby scripts/ci-tests/test_safety_checks.rb
ruby scripts/tests/test_communication.rb ruby scripts/ci-tests/test_communication.rb
clean: clean:
rm -rf $(INCDIR) $(LIBDIR) $(OUTDIR) $(EXEDIR) rm -rf $(INCDIR) $(LIBDIR) $(OUTDIR) $(EXEDIR)
......
...@@ -77,7 +77,7 @@ ensure ...@@ -77,7 +77,7 @@ ensure
Process.kill(2, quad) Process.kill(2, quad)
sleep 1 # wait for valgrind to write to file 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") file = File.open("./valgrind.out")
everything = file.readlines everything = file.readlines
last_line = everything.last last_line = everything.last
......
...@@ -51,7 +51,7 @@ Timeout::timeout(60) { ...@@ -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.") 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") 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) for i in (THROTTLE_MIN..THROTTLE_MAX).step(0.01)
set_throttle(i) set_throttle(i)
check_motors_are_off "Was able to turn on motors with GEAR off! Yikes!" check_motors_are_off "Was able to turn on motors with GEAR off! Yikes!"
...@@ -60,7 +60,8 @@ Timeout::timeout(60) { ...@@ -60,7 +60,8 @@ Timeout::timeout(60) {
end end
puts("Check that flipping gear to 1 while throttle is high does nothing") 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 sleep 0.01
check_motors_are_off "Motors turned on by gear while rc throttle was high! How dangerous!" check_motors_are_off "Motors turned on by gear while rc throttle was high! How dangerous!"
i = THROTTLE_MAX i = THROTTLE_MAX
...@@ -72,12 +73,12 @@ Timeout::timeout(60) { ...@@ -72,12 +73,12 @@ Timeout::timeout(60) {
sleep 0.005 sleep 0.005
end end
# (swtich GEAR back to off and bring throttle off) # Switch GEAR off and bring throttle off
set_gear GEAR_OFF set_gear GEAR_OFF
set_throttle THROTTLE_MIN set_throttle THROTTLE_MIN
puts("Check that the LED turns on when gear is flipped on") 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 set_gear GEAR_ON
sleep 0.01 sleep 0.01
check_motors_are_off "Motors turned on while throttle was low! Yikes!" check_motors_are_off "Motors turned on while throttle was low! Yikes!"
...@@ -129,7 +130,7 @@ Timeout::timeout(60) { ...@@ -129,7 +130,7 @@ Timeout::timeout(60) {
sleep 0.01 sleep 0.01
check_motors_are_off "Motors didn't turn off when GEAR was switched off! How dangerous!" 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 set_throttle THROTTLE_MIN
puts "All safety checks passed." puts "All safety checks passed."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment