I need to do some unit testing in my C project, which will be used in STM32F0 processor. I could test my abstraction code on x64 gcc, but the problem is i need a platform with little-endian (STM32F0 is little-endian by default). I tried to do some mods in project.yml file.
:project:
:use_exceptions: FALSE
:use_test_preprocessor: TRUE
:use_auxiliary_dependencies: TRUE
:build_root: build
# :release_build: TRUE
:test_file_prefix: test_
#:release_build:
# :output: MyApp.out
# :use_assembly: FALSE
:environment:
:extension:
:executable: .out
:paths:
:test:
- +:test/**
- -:test/support
:source:
- ../CDynTransport/src/
:support:
- test/support
:defines:
# in order to add common defines:
# 1) remove the trailing [] from the :common: section
# 2) add entries to the :common: section (e.g. :test: has TEST defined)
:commmon: &common_defines []
:test:
- *common_defines
- TEST
:test_preprocess:
- *common_defines
- TEST
:cmock:
:mock_prefix: mock_
:when_no_prototypes: :warn
:enforce_strict_ordering: TRUE
:plugins:
- :ignore
- :callback
:treat_as:
uint8: HEX8
uint16: HEX16
uint32: UINT32
int8: INT8
bool: UINT8
:tools:
:test_compiler:
:executable: arm-none-eabi-gcc
:arguments:
- "${1}"
- '-c'
- '-g'
- '-mcpu=cortex-m0'
- '-mthumb'
- '-Wall'
- '-Wno-address'
#- '-std=c99'
#- '-pedantic'
- -I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE #expands to -I search paths
- -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR #expands to -I search paths
- -D$: COLLECTION_DEFINES_TEST_AND_VENDOR #expands to all -D defined symbols
- -I"$": COLLECTION_PATHS_SOURCE_INCLUDE_VENDOR
- '-DTEST'
- '-DUNITY_EXCLUDE_STDINT_H'
- '-DUNITY_EXCLUDE_LIMITS_H'
- '-DUNITY_EXCLUDE_SIZEOF'
- '-DUNITY_INCLUDE_DOUBLE'
- '-DUNITY_SUPPORT_TEST_CASES'
- '-DUNITY_INT_WIDTH=32'
- '-DUNITY_LONG_WIDTH=32'
- '-DUNITY_INCLUDE_CONFIG_H'
:test_linker:
:executable: arm-none-eabi-gcc
:arguments:
- '-lm'
- '-mcpu=cortex-m0'
- '-mthumb'
- '-specs=nosys.specs'
#- '-T targets/gcc_armcortexM3/qemu.ld'
:test_simulator:
:executable: qemu-system-arm
:arguments:
- -cpu cortex-m3
- -M lm3s6965evb
- -no-reboot
- -nographic
- -kernel
:plugins:
:load_paths:
- vendor/ceedling/plugins
:enabled:
- stdout_pretty_tests_report
- module_generator
But still i have problems with compilation. For example:
Test 'test_command.c'
---------------------
Generating runner for test_command.c...
Compiling test_command_runner.c...
In file included from /home/slawek/CentralInterface/CDynTransportTest/vendor/ceedling/vendor/unity/src/unity.h:16:0,
from build/test/runners/test_command_runner.c:22:
/home/slawek/CentralInterface/CDynTransportTest/vendor/ceedling/vendor/unity/src/unity_internals.h:11:26: fatal error: unity_config.h: No such file or directory
#include "unity_config.h"
^
compilation terminated.
ERROR: Shell command failed.
> Shell executed command:
'arm-none-eabi-gcc build/test/runners/test_command_runner.c -c -g -mcpu=cortex-m0 -mthumb -Wall -Wno-address -I"test" -I"test/support" -I"../CDynTransport/src" -I"/home/slawek/CentralInterface/CDynTransportTest/vendor/ceedling/vendor/unity/src" -I"/home/slawek/CentralInterface/CDynTransportTest/vendor/ceedling/vendor/cmock/src" -I"build/test/mocks" -DTEST -I"../CDynTransport/src" -DTEST -DUNITY_EXCLUDE_STDINT_H -DUNITY_EXCLUDE_LIMITS_H -DUNITY_EXCLUDE_SIZEOF -DUNITY_INCLUDE_DOUBLE -DUNITY_SUPPORT_TEST_CASES -DUNITY_INT_WIDTH=32 -DUNITY_LONG_WIDTH=32 -DUNITY_INCLUDE_CONFIG_H'
> And exited with status: [1].
rake aborted!
ShellExecutionException: ShellExecutionException
/home/slawek/CentralInterface/CDynTransportTest/vendor/ceedling/lib/ceedling/tool_executor.rb:78:in `exec'
/home/slawek/CentralInterface/CDynTransportTest/vendor/ceedling/lib/ceedling/generator.rb:95:in `generate_object_file'
/home/slawek/CentralInterface/CDynTransportTest/vendor/ceedling/lib/ceedling/rules_tests.rake:17:in `block in <top (required)>'
/home/slawek/CentralInterface/CDynTransportTest/vendor/ceedling/lib/ceedling/task_invoker.rb:74:in `invoke_test_results'
/home/slawek/CentralInterface/CDynTransportTest/vendor/ceedling/lib/ceedling/test_invoker.rb:68:in `block in setup_and_invoke'
/home/slawek/CentralInterface/CDynTransportTest/vendor/ceedling/lib/ceedling/test_invoker.rb:32:in `setup_and_invoke'
/home/slawek/CentralInterface/CDynTransportTest/vendor/ceedling/lib/ceedling/tasks_tests.rake:11:in `block (2 levels) in <top (required)>'
Tasks: TOP => build/test/results/test_command.pass => build/test/out/test_command.out => build/test/out/test_command_runner.o
(See full trace by running task with --trace)
Do someone has ready-to-go configuration for Ceedling for STM32 microcontroller?
Related
dbtvault has already been added to the packages.yml file, the yaml file looks like this:
I am following a tutorial that can be found here: dbtset_up
This is a tutorial that I will on snowflake so that I can be able to provide the metadata and it will generate the sql for us and the required links and hubs.
name: dbtvault_snowflake_demo
profile: dbtvault_snowflake_demo
version: '5.3.0'
require-dbt-version: ['>=1.0.0', '<2.0.0']
config-version: 2
analysis-paths:
- analysis
clean-targets:
- target
seed-paths:
- seeds
macro-paths:
- macros
model-paths:
- models
test-paths:
- tests
target-path: target
vars:
load_date: '1992-01-08'
tpch_size: 10 #1, 10, 100, 1000, 10000
models:
dbtvault_snowflake_demo:
raw_stage:
tags:
- 'raw'
materialized: view
stage:
tags:
- 'stage'
enabled: true
materialized: view
raw_vault:
tags:
- 'raw_vault'
materialized: incremental
hubs:
tags:
- 'hub'
links:
tags:
- 'link'
sats:
tags:
- 'satellite'
t_links:
tags:
- 't_link'
I am getting an error when I ran this command:
dbt depsdbt
The error is as follows:
usage: dbt [-h] [--version] [-r RECORD_TIMING_INFO] [-d] [--log-format {text,json,default}]
[-
-no-write-json]
[--use-colors | --no-use-colors] [--printer-width PRINTER_WIDTH] [--warn-error] [--no-
version-check]
[--partial-parse | --no-partial-parse] [--use-experimental-parser] [--no-static-parser]
[--profiles-dir PROFILES_DIR]
[--no-anonymous-usage-stats] [-x] [--event-buffer-size EVENT_BUFFER_SIZE] [-q] [--no-
print]
[--cache-selected-only | --no-cache-selected-only]
{docs,source,init,clean,debug,deps,list,ls,build,snapshot,run,compile,parse,test,seed,run-
operation} ...
dbt: error: argument
{docs,source,init,clean,debug,deps,list,ls,build,snapshot,run,compile,parse,test,seed,run-
operation}: invalid choice: 'depsdbt' (choose from 'docs', 'source', 'init', 'clean', '
'debug', 'deps', 'list', 'ls', 'build', 'snapshot', 'run', 'compile', 'parse', 'test',
'seed', 'run-operation')
The command is:
dbt deps
I believe you tried to execute dbt depsdbt, which is not a command
I'm trying to get the react-native "Hello World" app setup with Detox and running on Bitrise.io. I went through the react-native-cli getting started guide and am trying to run the simplest detox test using Detox + Jest on Bitrise with it.
The specific error I'm encountering is the device and element globals not being defined (see log or in the link below). From what I've researched so far, this is caused by detox.init not ever finishing.
Is there some basic config with Bitrise that I'm missing? The detox test command runs locally for me just fine.
I'm using a free Bitrise account, and the project is public. You can see a failed build here: https://app.bitrise.io/build/e7926ddfc759288f#?tab=log
The repo is also public: https://github.com/jamesopti/react-native-test/blob/add_detox/AwesomeProject/e2e/firstTest.spec.js
Thanks in advance!
Bitrise Error Log
Example: should have welcome screen
Example: should have welcome screen [FAIL]
FAIL e2e/firstTest.spec.js (122.008s)
Example
✕ should have welcome screen (8ms)
● Example › should have welcome screen
Timeout - Async callback was not invoked within the 120000ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 120000ms timeout specified by jest.setTimeout.
at mapper (../node_modules/jest-jasmine2/build/queueRunner.js:25:45)
● Example › should have welcome screen
ReferenceError: device is not defined
1 | describe('Example', () => {
2 | beforeEach(async () => {
> 3 | await device.reloadReactNative();
| ^
4 | });
5 |
6 | it('should have welcome screen', async () => {
bitrise.yml
---
format_version: '8'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: react-native
trigger_map:
- push_branch: "*"
workflow: primary
- pull_request_source_branch: "*"
workflow: primary
workflows:
deploy:
description: "## ..."
steps:
- activate-ssh-key#4.0.3:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone#4.0.17: {}
- script#1.1.5:
title: Do anything with Script step
- yarn#0.1.0:
inputs:
- workdir: AwesomeProject
- command: install
- install-missing-android-tools#2.3.7:
inputs:
- gradlew_path: "$PROJECT_LOCATION/gradlew"
- android-build#0.10.0:
inputs:
- project_location: "$PROJECT_LOCATION"
- certificate-and-profile-installer#1.10.1: {}
- xcode-archive#2.7.0:
inputs:
- project_path: "$BITRISE_PROJECT_PATH"
- scheme: "$BITRISE_SCHEME"
- export_method: "$BITRISE_EXPORT_METHOD"
- configuration: Release
- deploy-to-bitrise-io#1.9.2: {}
primary:
steps:
- activate-ssh-key#4.0.3:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone#4.0.17: {}
- yarn#0.1.0:
inputs:
- workdir: AwesomeProject
- command: install
title: Yarn Install
- yarn#0.1.0:
inputs:
- workdir: AwesomeProject
- command: test
title: Unit tests
after_run:
- detox
detox:
steps:
- cocoapods-install#1.9.1:
inputs:
- source_root_path: "$BITRISE_SOURCE_DIR/AwesomeProject/ios"
- npm#1.1.0:
title: Install Global
inputs:
- workdir: "$BITRISE_SOURCE_DIR/AwesomeProject"
- command: install -g detox-cli react-native-cli
- script#1.1.5:
inputs:
- working_dir: "$BITRISE_SOURCE_DIR/AwesomeProject"
- content: |-
#!/usr/bin/env bash
brew tap facebook/fb
export CODE_SIGNING_REQUIRED=NO
brew install fbsimctl
brew tap wix/brew
brew install applesimutils --HEAD
title: Install detox utils
- script#1.1.5:
inputs:
- working_dir: "$BITRISE_SOURCE_DIR/AwesomeProject"
- content: |-
#!/usr/bin/env bash
detox build --configuration ios.sim.debug
title: Detox Build
- script#1.1.5:
inputs:
- working_dir: "$BITRISE_SOURCE_DIR/AwesomeProject"
- content: |-
#!/usr/bin/env bash
detox test --configuration ios.sim.debug --cleanup
title: Detox Test
app:
envs:
- opts:
is_expand: false
PROJECT_LOCATION: AwesomeProject/android
- opts:
is_expand: false
MODULE: app
- opts:
is_expand: false
VARIANT: ''
- opts:
is_expand: false
BITRISE_PROJECT_PATH: AwesomeProject/ios/AwesomeProject.xcworkspace
- opts:
is_expand: false
BITRISE_SCHEME: AwesomeProject
- opts:
is_expand: false
BITRISE_EXPORT_METHOD: ad-hoc
meta:
bitrise.io:
machine_type: elite
Unfortunately, this is a very generic bug and can be caused by multiple things (incompatible OS/jest + detox versions/node + detox versions, etc).
If you're using MacOS, an option you can take in able to check what's going wrong in Bitrise's VM is connecting via Screen Sharing: I'd suggest adding a while someFileDoesntExist (to stop iteration naturally without the abort button) in your current workflow after the packages installation steps (node, detox, jest etc) and then checking if its the same one you're running locally.
If that's not the case, check if the VM is running the same simulator -- phone model && OS version; if its not, then you can specify the simulator & OS version in your detox configuration.
If that also didn't work, I'm not sure what it could be :(
As the subject says. I have some host variables defined in my hosts inventory file. How do I access them in my playbook?
Here is an example. Based on all my research I was expecting foo and bar to be part of hostvars. I can put host specific variables in separate var files, but I would love to keep them in my inventory file "attached" to a host. I don't want to use it in templates.
ansible version: 1.3.2, ansible_distribution_version: 6.4
bash $
bash $ ansible --version
ansible 1.3.2
bash $
bash $ cat test_inv.ini
[foobar]
someHost foo="some string" bar=123
someOtherHost foo="some other string" bar=456
bash $
bash $ cat test.yml
---
- name: test variables...
hosts: all
vars:
- some_junk: "1"
# gather_facts: no # foo and bar are unavailable whether I gather facts or not.
tasks:
- debug: msg="hostvars={{hostvars}}"
- debug: msg="vars={{vars}}"
- debug: msg="groups={{groups}}"
- debug: msg="some_junk={{some_junk}}"
# - debug: msg="???? HOW DO I PRINT values of host specific variables foo and bar defined in inventory file ???"
bash $
bash $
bash $ ansible-playbook -i test_inv.ini test.yml
PLAY [test variables...] ******************************************************
GATHERING FACTS ***************************************************************
ok: [someHost]
TASK: [debug msg="hostvars={{hostvars}}"] *************************************
ok: [someHost] => {"msg": "hostvars={'someHost': {u'facter_operatingsystem': u'RedHat', u'facter_selinux_current_mode': u'enforcing', u'facter_hostname': u'someHost', 'module_setup': True, u'facter_memoryfree_mb': u'1792.70', u'ansible_distribution_version': u'6.4' // ...........snip...........// u'VMware IDE CDR10'}}"}
TASK: [debug msg="vars={{vars}}"] *********************************************
ok: [someHost] => {"msg": "vars={'some_junk': '1', 'delegate_to': None, 'changed_when': None, 'register': None, 'inventory_dir': '/login/sg219898/PPP/automation/ansible', 'always_run': False, 'ignore_errors': False}"}
TASK: [debug msg="groups={{groups}}"] *****************************************
ok: [someHost] => {"msg": "groups={'ungrouped': [], 'foobar': ['someHost'], 'all': ['someHost']}"}
TASK: [debug msg="some_junk=1"] ***********************************************
ok: [someHost] => {"msg": "some_junk=1"}
PLAY RECAP ********************************************************************
someHost : ok=5 changed=0 unreachable=0 failed=0
bash $
Doing the following should work:
debug: msg="foo={{foo}}"
The foo variable will be evaluated in the context of the current host. Tested locally with ansible 1.3.4.
I'm under nginx + passenger + rails 3.2.1 and when i try to start my app i get
cannot load such file -- rubygems/path_support
the output of gem environment is
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.23
- RUBY VERSION: 1.9.3 (2012-11-10 patchlevel 327) [i686-linux]
- INSTALLATION DIRECTORY: /root/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /root/.rbenv/versions/1.9.3-p327/bin/ruby
- EXECUTABLE DIRECTORY: /root/.rbenv/versions/1.9.3-p327/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /root/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1
- /root/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
and in my nginx.conf i have
user root;
http {
passenger_root /root/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/passenger-3.0.19;
passenger_ruby /root/.rbenv/versions/1.9.3-p327/bin/ruby;
passenger_default_user root;
passenger_default_group root;
....
what else can i check?
Thank you
thanks a lot ! the code in your config file saved my life:
passenger_default_user root;
passenger_default_group root;
I met the same error with your and solved with your config file , the detailed answer is here: https://stackoverflow.com/a/15777738/445908
I'm struggling a bit with getting my unicorn and delayed_job processes reboot-proof. I've settled on using bluepill as the overall manager as this can easily be started with upstart in Ubuntu. I've created an RVM wrapper for bluepill and the upstart script works well (starts and stops with ease:
# bluepill - process monitor
#
# simple process monitoring tool
description "simple process monitoring tool"
start on started nginx
stop on stopping nginx
expect daemon
#respawn
exec bootup_bluepill load /home/deployer/apps/nzswarranty/current/config/production.pill
Next up comes the bluepill config file:
Bluepill.application("nzswarranty", :log_file => "/var/log/bluepill.log") do |app|
app.working_dir = '/home/deployer/apps/nzswarranty/current'
app.uid = "deployer"
app.gid = "staff"
app.process("unicorn") do |process|
process.start_command = "bundle exec unicorn_rails -c config/unicorn.rb -D"
process.stop_command = "kill -s QUIT `cat /tmp/unicorn.nzswarranty.pid`"
process.restart_command = "kill -s USR2 `cat /tmp/unicorn.nzswarranty.pid`"
process.pid_file = '/tmp/unicorn.nzswarranty.pid'
process.start_grace_time = 15.seconds
process.stop_grace_time = 15.seconds
end
app.process("delayed_job") do |process|
process.environment = { 'RAILS_ENV' => 'production' }
process.start_command = 'script/delayed_job start'
process.stop_command = 'script/delayed_job stop'
process.pid_file = '/home/deployer/apps/nzswarranty/shared/pids/delayed_job.pid'
process.start_grace_time = 15.seconds
process.stop_grace_time = 15.seconds
end
end
The server has system-wide RVM installed and bundler managing the gems. I should mention this is a Rails 3.1 app.
Basically when I start bluepill without delayed_job already running I get this when it tries to boot it up:
W, [2012-01-05T13:37:55.185626 #28201] WARN -- : [nzswarranty:delayed_job] Start command execution returned non-zero exit code:
W, [2012-01-05T13:37:55.185780 #28201] WARN -- : [nzswarranty:delayed_job] {:stdout=>"", :stderr=>"/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- bundler/setup (LoadError)\n\tfrom /usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'\n\tfrom /home/deployer/apps/nzswarranty/current/config/boot.rb:6:in `<top (required)>'\n\tfrom <internal:lib/rubygems/custom_require>:29:in `require'\n\tfrom <internal:lib/rubygems/custom_require>:29:in `require'\n\tfrom /home/deployer/apps/nzswarranty/current/config/application.rb:1:in `<top (required)>'\n\tfrom <internal:lib/rubygems/custom_require>:29:in `require'\n\tfrom <internal:lib/rubygems/custom_require>:29:in `require'\n\tfrom /home/deployer/apps/nzswarranty/current/config/environment.rb:2:in `<top (required)>'\n\tfrom <internal:lib/rubygems/custom_require>:29:in `require'\n\tfrom <internal:lib/rubygems/custom_require>:29:in `require'\n\tfrom script/delayed_job:3:in `<main>'\n", :exit_code=>1}
I, [2012-01-05T13:37:55.186003 #28201] INFO -- : [nzswarranty:delayed_job] Going from down => starting
I've tried using bundle exec for this also and it just says it can't find the bundle executable. My suspicion is that the environment isn't being loaded correctly. Any tips? I have an RVM gemset which is loaded from the .rvmrc file in the root of the project. Should I be switching to this gemset in the bluepill config also?
Ok, so it was pretty easy in the end. I think what was happening is that I installed bluepill in the global rvm gemset as root and also created my wrapper to use the global gemset in the environment (meaning bluepill started ok but it didn't see any of the other gems in my proper gemset (warranty)). I basically removed bluepill from the global gemset and installed it in the warranty gemset. I then created the wrapper again:
rvmsudo rvm wrapper ruby-1.9.2-p290#warranty bootup bluepill
I also encountered another strange error when trying to boot up unicorn but realised I wasn't passing the RAILS_ENV in. Here's my final .pill:
Bluepill.application("nzswarranty", :log_file => "/var/log/bluepill.log") do |app|
app.working_dir = '/home/deployer/apps/nzswarranty/current'
app.uid = 'deployer'
app.gid = 'staff'
app.environment = { 'RAILS_ENV' => 'production' }
app.process("unicorn") do |process|
process.start_command = "bundle exec unicorn_rails -c config/unicorn.rb -D"
process.stop_command = "kill -s QUIT `cat /tmp/unicorn.nzswarranty.pid`"
process.restart_command = "kill -s USR2 `cat /tmp/unicorn.nzswarranty.pid`"
process.pid_file = '/tmp/unicorn.nzswarranty.pid'
process.start_grace_time = 30.seconds
process.stop_grace_time = 30.seconds
end
app.process("delayed_job") do |process|
process.start_command = 'bundle exec script/delayed_job start'
process.stop_command = 'bundle exec script/delayed_job stop'
process.pid_file = '/home/deployer/apps/nzswarranty/shared/pids/delayed_job.pid'
process.start_grace_time = 30.seconds
process.stop_grace_time = 30.seconds
end
end
It's important to note that we need to use bundle exec before our other commands so that we're loading up the full set of gems from the Gemfile.