Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Large tests and runnable example #11

Merged
merged 1 commit into from
Oct 13, 2016

Conversation

marcin-krolik
Copy link
Collaborator

  • added large tests
  • added runnable example

@intelsdi-x/plugin-maintainers

@marcin-krolik
Copy link
Collaborator Author

PR #10 has to be merged before this one in order to enable runnable example and large test to download plugin binary from S3

Copy link

@IRCody IRCody left a 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)
Copy link

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?

Copy link
Collaborator Author

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"
Copy link

@IRCody IRCody Sep 16, 2016

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.

Copy link
Collaborator Author

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")
Copy link

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"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed typo

@nanliu
Copy link
Contributor

nanliu commented Sep 16, 2016

@marcin-krolik, I've been playing with large tests in serverspec:
intelsdi-x/snap-plugin-collector-ethtool#20

If we are interested in using python, could we use a test framework like testinfra?
https://testinfra.readthedocs.io/en/latest/

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.

@marcin-krolik
Copy link
Collaborator Author

@IRCody

I think it would be beneficial to get consensus on that before going to far down different roads for large tests across multiple plugins.

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.

@marcin-krolik marcin-krolik force-pushed the feat/large-test branch 2 times, most recently from fd7b8bf to 5d4f7de Compare September 22, 2016 11:53
@marcin-krolik
Copy link
Collaborator Author

Large test will fail at the end with error AssertionError: Errors found during snapd execution due to bug

@marcin-krolik marcin-krolik force-pushed the feat/large-test branch 2 times, most recently from 831c0ad to f5a18ce Compare September 29, 2016 16:27
@marcintao
Copy link

LGTM

@@ -0,0 +1,3 @@
[submodule "scripts/test/pytest"]
path = scripts/test/pytest
url = https://github.com/marcin-krolik/snap-pytest
Copy link

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?

Copy link
Collaborator Author

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.

@marcin-krolik
Copy link
Collaborator Author

@IRCody Submodule is removed. Additionally I updated paths to S3, added glide.lock, script for running large tests on local k8s (minikube).

Copy link

@IRCody IRCody left a 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.

@marcin-krolik
Copy link
Collaborator Author

@IRCody removed .gitmodules

@marcin-krolik marcin-krolik merged commit 367ed3c into intelsdi-x:master Oct 13, 2016
# 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 ]];

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`,

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

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants