-
Notifications
You must be signed in to change notification settings - Fork 10
Large tests and runnable example #11
Large tests and runnable example #11
Conversation
PR #10 has to be merged before this one in order to enable runnable example and large test to download plugin binary from S3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we also need to standardize on some sort of large testing style for all of the plugins. I'm not sure what that is but I think it would be beneficial to get consensus on that before going to far down different roads for large tests across multiple plugins.
|
||
_info "downloading plugins" | ||
(cd $PLUGIN_PATH && curl -sSO http://snap.ci.snap-telemetry.io/snap/master/latest/snap-plugin-publisher-mock-file && chmod 755 snap-plugin-publisher-mock-file) | ||
(cd $PLUGIN_PATH && curl -sSO http://snap.ci.snap-telemetry.io/snap/master/latest/snap-plugin-processor-passthru && chmod 755 snap-plugin-processor-passthru) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since passthru isn't loaded below, does it need to be downloaded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be loaded. Added loading of passthru
snapctl plugin load "${PLUGIN_PATH}/snap-plugin-collector-load" | ||
|
||
_info "creating and starting a task" | ||
snapctl task create -t "${__dir}/task-mem.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file doesn't seem to exist AFAICT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed to proper task manifest file
log.info("stopping snapd") | ||
self.binaries.snapd.stop() | ||
if self.binaries.snapd.isAlive(): | ||
log.warn("snapd thread did not died") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"snapd thread did not die"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed typo
@marcin-krolik, I've been playing with large tests in serverspec: If we are interested in using python, could we use a test framework like testinfra? Either serverspec or testinfra would allow us to write much more succinct tests and be platform agnostic. As our test matrix gets more complex there's a lot of value to leverage a framework so we can focus on test instead of getting everything ready to test. We should discuss this in next weeks sync up. |
I agree. @nanliu I'm not familiar with neither serverspec nor testinfra. My try with wrapper module and unittest is a proposition of simple framework for large test. I wanted to keep docker image small as possible, thus I didn't want to add any additional dependencies and used standard modules + my own implementation. I'm opened for discussion and I totally agree with your point we need some kind of test framework for large tests. |
fd7b8bf
to
5d4f7de
Compare
Large test will fail at the end with error |
831c0ad
to
f5a18ce
Compare
LGTM |
@@ -0,0 +1,3 @@ | |||
[submodule "scripts/test/pytest"] | |||
path = scripts/test/pytest | |||
url = https://github.com/marcin-krolik/snap-pytest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the conversation this morning, do we still want to use submodules? My understanding was things would be moving to pip instead. Do you agree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@IRCody Yes, I will prepare pip package.
f5a18ce
to
489314e
Compare
@IRCody Submodule is removed. Additionally I updated paths to S3, added glide.lock, script for running large tests on local k8s (minikube). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than the empty .gitmodules file.
489314e
to
c05d06f
Compare
@IRCody removed .gitmodules |
# this block will wait check if snapctl and snapd are loaded before the plugins are loaded and the task is started | ||
for i in `seq 1 10`; do | ||
_info "try ${i}" | ||
if [[ -f /usr/local/bin/snapctl && -f /usr/local/bin/snapd ]]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to use the renamed binaries?
|
||
## Files | ||
- [mock-load.sh](mock-load.sh) | ||
- Downloads `snapd`, `snapctl`, `snap-plugin-collector-load`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
binaries renamed from snapctl/snapd to snaptel/d
- Verifies dependencies and starts the containers. It's called | ||
by [run-mock-load.sh](run-mock-load.sh). | ||
- [docker-compose.yml](docker-compose.yml) | ||
- A docker compose file which defines "runner" container where snapd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
binaries renamed from snapctl/snapd to snaptel/d
@intelsdi-x/plugin-maintainers