electric-cloud / ec-chef Goto Github PK
View Code? Open in Web Editor NEWElectricFlow integration for Chef
License: Apache License 2.0
ElectricFlow integration for Chef
License: Apache License 2.0
See PR. Comment copied from PR
This is not platform independent and will not work on Windows. Can you instead write to current working directory (which is typically the scoped to the job)?
I would recommend taking a look at http://perldoc.perl.org/File/Temp.html . It's a good idea to always add a bit of randomness to the file name to support parallel execution. See examples in perldoc. We've used File::Temp and this pattern in other plugins.
Right now it looks like the user and password are hardcoded to 'username' and 'password'. My machine does not have this user or password so the test does not pass.
With gradle plugin, we have three tasks for tests, one for integration tests (systemtest) and two others for unit testing of perl and java (GWT) code (unittest & test).
Solely purpose of unit tests is to make them run as fast as possible, and independent from working environment (Flow Server & Agent).
For integration testing (which use EF & Agent), we have separate tests, which are based on ntest framework, and which we are actively using in our CI procedures.
I've made modifications to support java-based system tests in or new CI system, but please, note, that system tests is more preferred way for us to do integration testing. So, in future, please, use ntest framework. Ask me, if you have any questions on how to setup CI tests with ntest.
As brought up in this #11 .
$ec->abortOnError
Use credential parameter instead. We should never ask for a password and store it in clear text.
For the procedure 'Bootstrap' in EC-Chef, the parameter 'ssh_password' is currently 'entry'. 'ssh_password' and 'ssh_user' can be combined into a credential parameter.
This is a blocker and the plugin cannot be shipped unless this is addressed.
We should not emit the password in the step log file. Can we write a file and put the password inside?
If there is no other way but to pass the password on the command line then we should either not emit the command line or hide the password ([PROTECTED] or '**'')
We should not be adding additional global variables
For the files that you've created/recently added please avoid global variables
To reproduce:
Run find . -name "*.pl" | xargs fgrep -l "$::"
find . -name "*.pl" | xargs fgrep -l "$::"
./src/main/resources/project/drivers/AddRecipesToNodeRunListDriver.pl
./src/main/resources/project/drivers/CreateNodeDriver.pl
./src/main/resources/project/drivers/DeleteSingleNodeDriver.pl
./src/main/resources/project/drivers/DownloadCookbookFromRepositoryDriver.pl
./src/main/resources/project/drivers/EditNodeDriver.pl
./src/main/resources/project/drivers/InstallCookbookOnClientDriver.pl
./src/main/resources/project/drivers/ListNodeDriver.pl
./src/main/resources/project/drivers/RemoveRecipesFromNodeRunListDriver.pl
./src/main/resources/project/drivers/RunChefClientDriver.pl
./src/main/resources/project/drivers/ShowNodeDriver.pl
./src/main/resources/project/drivers/UploadCookbooksToServerDriver.pl
./src/main/resources/project/postp_matchers.pl
Ideally this find + fgrep command would return no results. But this issue to keep track of the global vars being introduced into the new features
User should be able to upload new cookbook(s) to a chef server using the plugin
We use Docker for CI tests (server-side deployments) and CentOS 6.4 for machines running EF Agents.
So, to setup CI tests for this plugin, we need Dockerfile for server, and instructions for setting up client on Agent machine (CentOS 6.4).
Will update this description as I find out more.
Acceptance criteria-
After reading the README a user should be able to successfully run all tests on a fresh linux box (after following the instructions).
Now that we have tests can we get a little bit of a write up on how to run them?
They should be geared towards new contributors. What are the pre-reqs: what sofware needs to be installed, what files need to be created/ what information from the chef server do we need?
After writing them please use a fresh vagrant box and try out the instructions as that is ultimately what I will do (aka Acceptance criteria).
Steps to reproduce
{
"name": "test-role1",
"description": "foo",
"json_class": "Chef::Role",
"default_attributes": {
},
"override_attributes": {
},
"chef_type": "role",
"run_list": [
],
"env_run_lists": {
}
}
Run the EditRole procedure, change the 'description' in the json above to something like 'foo2'.
Run procedure
EXPECTED -
Role is edited and job step log reinforces that impression
ACTUAL -
Role is first deleted and then created. Job step output says 'Success: No changes applied' but the description was changed.
Side note: Do we need to issue the delete? From chef documentation it looks like we only need to issue knife role from file FILE
The way i see it, you can replace the existing databag with updated contents
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.