TFS RM: How to turn off debug info - tfs-2015

I'm using the Powershell on Target Machines task in a release definition.
This task is producing by default a lot of debug info in the logs:
2016-04-19T09:29:13.9259230Z Executing the powershell script:
C:\Temp\agent2\tasks\PowerShellOnTargetMachines\1.0.2\PowerShellOnTargetMachines.ps1
2016-04-19T09:29:14.0665281Z ##[debug]Entering script
PowerShellOnTargetMachines.ps1 2016-04-19T09:29:14.0665281Z
2016-04-19T09:29:14.0665281Z ##[debug]protocol =
Http
2016-04-19T09:29:14.0665281Z ##[debug]resourceFilteringMethod =
machineNames
2016-04-19T09:29:14.0665281Z ##[debug]scriptPath = C:\RM\foobar\2013.10.16110.02-01\foobar.ps1
2016-04-19T09:29:14.0665281Z ##[debug]scriptArguments =
-foobar DEV -foobar "foobar"
2016-04-19T09:29:14.0821546Z ##[debug]runPowershellInParallel = true
2016-04-19T09:29:14.0665281Z ##[debug]testCertificate =
true
=2016-04-19T09:29:14.0665281Z ##[debug]initializationScriptPath =
2016-04-19T09:29:14.0665281Z ##[debug]machineNames
and so on.
How can I turn this debug info off?

No such setting to turn off the debug info by default.
But you can modify the .ps1 files in PowerShellOnTargetMachines task by removing -Verbose flags, then you won't see the debug info.

Related

Jenkins pipeline executing msbuild.exe (2019) build.xml - The batch file cannot be found

pipeline {
agent { label 'Apps' }'''
environment {
MSBUILD_4_PATH = "c:\\WINDOWS\\Microsoft.NET\\Framework\\v4.0.30319\\msbuild"
MSBUILD_2019_PATH = "c:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\MSBuild\\Current\\Bin\\MSBuild.exe"
GLOBAL_SETTINGS = "\\PATH\\TO\\msbuild_settings"
BUILD_TYPE = "Dev"
// ------
}
stage('Build Infra - Release and Test') {
steps {
dir("${env.WORKSPACE}/${BRANCH_NAME}/Infra/Build"){
bat '''
set DevEnvDir="c:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\IDE\\"
"%MSBUILD_2019_PATH%" Build.xml /p:GlobalSettings=%GLOBAL_SETTINGS%;BUILD_TYPE=%BUILD_TYPE%;SC=GIT;MSBuildCommunityTasksPath="C:\\Program Files (x86)\\MSBuild\\MSBuildCommunityTasks";ExtensionTasksPath="C:\\\\Program Files (x86)\\\\MSBuild\\\\ExtensionPack\\\\4.0\\\\" /t:ReleaseAndTest
'''
}
}
}
Please help, cant find root cause of the problem
Log finished with:
375 Warning(s)
0 Error(s)
Time Elapsed 00:04:54.35
The batch file cannot be found.
Cant realize if the problem is with Jenkins pipeline or MsBuild itself
stage never finished... stack
Tried many different options and still stack

WebdriverIo is not able to initialize wdio-rerun-service : Getting below error

[0-13] 2022-05-25T04:33:05.332Z DEBUG #wdio/utils:initialiseServices: initialise service "selenium-standalone" as NPM package
[0-13] 2022-05-25T04:33:05.350Z DEBUG #wdio/utils:initialiseServices: initialise service "RerunService" as NPM package
[0-13] 2022-05-25T04:33:05.351Z ERROR #wdio/utils:initialiseServices: Error: Couldn't find plugin "RerunService" service, neither as wdio scoped package "#wdio/rerunservice-service" nor as community package "wdio-rerunservice-service". Please make sure you have it installed!
at Object.initialisePlugin [as default] (/Users//dotor/dot-or-automation/node_modules/#wdio/runner/node_modules/#wdio/utils/build/initialisePlugin.js:26:11)
at initialiseServices (/Users/****/dotor/dot-or-automation/node_modules/#wdio/runner/node_modules/#wdio/utils/build/initialiseServices.js:24:51)
at Object.initialiseWorkerService (/Users//dotor/dot-or-automation/node_modules/#wdio/runner/node_modules/#wdio/utils/build/initialiseServices.js:67:26)
at Runner.run (/Users/*******/dotor/dot-or-automation/node_modules/#wdio/runner/build/index.js:43:17)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
[0-13] Capabilities: {"maxInstances":2,"browserName":"chrome","acceptInsecureCerts":true,"goog:chromeOptions":{}}
[0-13] 2022-05-25T04:33:05.437Z DEBUG #wdio/sync: Finished to run "beforeSession" hook in 0ms
2022-05-25T04:33:05.800Z DEBUG #wdio/local-runner: Runner 0-13 finished with exit code 0
2022-05-25T04:33:05.800Z INFO #wdio/cli: [0-13] SKIPPED in chrome - /automation/features/ui/Others/setting-wheel.feature
2022-05-25T04:33:05.800Z INFO #wdio/cli:launcher: Run onWorkerEnd hook
Not sure if you already found your answer for this but if you haven't. The webdriverio doc explains it well.
// wdio.conf.js
const RerunService = require('wdio-rerun-service');
export.config = {
// ...
services: [RerunService, {
// ...
}]
};
This service is slightly configured differently compared to the other ones.
Note that we are importing the service and using it in the config object. Other services are usually called directly after installation, and the name of the service is usually a string example:
export.config = {
// ...
services: ["selenium-standalone", {
// ...
}]
};

Odoo Server Conf SyntaxError Centos 6.9

Yesterday I installed Odoo in Centos 6.9
PostgreSql Successfully Installed and running
Odoo successfully Installed but when I start odoo service Error Occured
[root#inj ~]# service odoo start
Starting Odoo Server Daemon (odoo-server): [ OK ]
[root#inj ~]# File "", line 1
/etc/odoo-server.conf
^
SyntaxError: invalid syntax
and here is my conf File
[options]
admin_passwd = *****************************
db_host = localhost
db_port = 5432
db_user = odoo
db_password = *****************************
addons_path = /opt/odoo/addons
load = web
timezone = Asia/Dubai
without-demo=all
logfile = /var/log/odoo/odoo-server.log
log_handler = werkzeug:WARNING
log_level = warn
no-logrotate = True
Check Error Image
The options on the config file should not have dashes but underscores. So try without_demo = True and logrotate = False and isntead of load = web try server_wide_modules = web
Also make sure that every option that you have set is valid, you can see the valid options here. Check the dest attribute.

Setting up Continuous Integration of Protractor using Jenkins

I am writing automation test scripts using Protractor and now I need to set up the CI for this using Jenkins.
Tasks it needs to perform are:
Starting the selenium standalon server.
Starting the test using conf.js file.
Stopping the selenium standalone server.
Can anyone help in this regard?
I created a small bash script to do this.
# start selenium
./node_modules/protractor/bin/webdriver-manager start > /dev/null 2>&1 &
# wait until selenium is up
while ! curl http://localhost:4444/wd/hub/status &>/dev/null; do :; done
# run the build
grunt cibuild --force
# stop selenium
curl -s -L http://localhost:4444/selenium-server/driver?cmd=shutDownSeleniumServer > /dev/null 2>&1
This script is invoked from a free-style project in jenkins (Build > Execute shell)
Then the test result report is generated by reading the protractor test results. Hence, you have to produce junit reports from protractor, (look here) :
onPrepare: function() {
// The require statement must be down here, since jasmine-reporters
// needs jasmine to be in the global and protractor does not guarantee
// this until inside the onPrepare function.
require('jasmine-reporters');
jasmine.getEnv().addReporter(
new jasmine.JUnitXmlReporter('xmloutput', true, true));
},
To make the report visible in jenkins i add a post build action in the job: Publish JUnit test result report:
Alternatively, you could run this as a Grunt Task. First install grunt on Jenkins. Install the NPM packages for protractor_webdriver and protractor. Setup the configuration file to point the the node_module path and config file paths.
http://sideroad.secret.jp/articles/grunt-on-jenkins/
Then install protractor node modules. The Gruntfile would look similar to this. I created a test directory where the conf and spec files would be located.
module.exports = function (grunt) {
grunt.initConfig({
protractor_webdriver: {
your_target: {
options: {
path: 'node_modules/protractor/bin/',
command: 'webdriver-manager start'
}
}
},
protractor: {
options: {
configFile: "node_modules/protractor/referenceConf.js", // Default config file
keepAlive: true, // If false, the grunt process stops when the test fails.
noColor: false, // If true, protractor will not use colors in its output.
args: {
// Arguments passed to the command
}
},
your_target: {
options: {
configFile: "test/conf.js", // Target-specific config file
args: {} // Target-specific arguments
}
}
}
});
grunt.registerTask('p:test', [
'protractor_webdriver',
'protractor'
]);
});
The newest protractor allows you to run the selenium standalone server directly from the conf.js (or whatever protractor entry point you have).
comment out (or delete) the seleniumAddress: 'http://localhost:4444/wd/hub', line, and replace it with seleniumServerJar: './node_modules/protractor/selenium/latest.jar'.
latest.jar isn't installed by default, I created it as a symlink to the latest version installed via npm install protractor --save. This gives longer life to my conf.js files in the same directory.
Within the ./node_modules/protractor/selenium/ folder I ran ln -s selenium-server-standalone-2.48.2.jar latest.jar
You can use Gulp which is far simpler.
After installing gulp in Jenkins System , you may install the npm dependencies(npm install) & run gulp tasks directly as windows batch command in Jenkins as below:
In the background to make selenium server up and running and providing various other parameters , you may use packages like 'gulp-angular-protractor' in the gulpfile.js as below:
gulpfile.js
'use strict';
var gulp = require('gulp'),
gulpProtractorAngular = require('gulp-angular-protractor'),
gulpStart = gulp.Gulp.prototype.start,
currentStartTaskName;
gulp.Gulp.prototype.start = function (task) {
currentStartTaskName = task;
gulpStart.apply(this, arguments);
};
function executeWebTests(suiteName, appName) {
return gulp.src([])
.pipe(gulpProtractorAngular({
'configFile': './conf.js',
'debug': false,
'autoStartStopServer': true,
args: [
'--suite', suiteName,
'--capabilities.browserName', 'chrome',
'--params.APPNAME', appName,
'--params.SUITENAME', currentStartTaskName,
'--capabilities.platformName', 'Windows'],
keepAlive: false
}))
.on('error', function (e) {
console.log('Ended with below ERROR::',e);
process.exit(1);
})
.on('end', function () {
console.log('Test complete');
process.exit();
});
}
gulp.task('RegressionSuiteTask', function () {
executeWebTests('regressionTests,','Application_Name');
});
conf.js
suites: {
regressionTests: ['testCases/**/*.js']//will run all specs in subfolders
},
I know this already resolved and want to target for beginner to create Jenkins job and running test. I suggest to use selenium-server-standalone jar in configuration file and call configuration file from Jenkins.
conf.js
..
exports.config = {
//seleniumAddress: 'http://localhost:4444/wd/hub',
seleniumServerJar: 'node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.5.3.jar',
....
//html reporter logic
.....
Creating Jenkins Job
Install node js on Jenkins Server
Install Html Publisher Plugin for end to end testing report
Create Freestyle Project or whatever your needs
Go to Build Section -> Add build step and choose Execute Windows
batch command if Jenkins server in Windows otherwise choose Execute
Shell for Linux
Call conf.js (install packages and call your configuration file)
For reporting Got to Post-Build Actions Section -> Add Publish Html
Reports and call your report file (file assuming from root of your
project)
However you can customize execution command using gulp or similar other packages. Thanks

Run remote rake task from capistrano, cap deploy bash: -c: line 1: syntax error: unexpected end of file

I followed the answer from #Coward in this topic: How do I run a rake task from Capistrano?
to add a customizing task rake:invoke in my deploy.rb to be able to invoke rake tasks remotely.
It works perfect on it's own part, but I get following error when my cap deploy processing is doing assets:precompile
[mydomain.com] rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell '1.9.2#ziya' -c 'cd /var/deploy/ziya/releases/20120223100338 && #<Capistrano::Configuration::Namespaces::Namespace:0x007ff2b4a4bad8> RAILS_ENV=staging RAILS_GROUPS=assets assets:precompile'
** [out :: my domain.com] bash: -c: line 1: syntax error: unexpected end of file
command finished in 1265ms
it's like kind of injection something, but I just can't find out what's going wrong in my deploy.rb
deploy.rb:
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path.
require "rvm/capistrano" # Load RVM's capistrano plugin.
set :rvm_ruby_string, '1.9.2#ziya'
set :use_sudo, true
require "bundler/capistrano"
set :stages, %w(staging production)
set :default_stage, "production"
require 'capistrano/ext/multistage'
set :application, "my application"
# ssh to the deploy server
default_run_options[:pty] = true
# setup scm:
set :repository, "mygiturl"
set :deploy_via, :remote_cache
set :scm_username, "myusernmae"
set :scm, :git
set :scm_verbose, "true"
set :branch, "master"
ssh_options[:forward_agent] = true
set(:releases_path) { File.join(deploy_to, version_dir) }
set(:shared_path) { File.join(deploy_to, shared_dir) }
set(:current_path) { File.join(deploy_to, current_dir) }
set(:release_path) { File.join(releases_path, release_name) }
set :deploy_to, "/var/deploy/#{application}"
# If you are using Passenger mod_rails uncomment this:
namespace :deploy do
task :start do ; end
task :stop do ; end
task :restart, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
task :bootstrap do
run "cd #{release_path}; rake bootstrap:all RAILS_ENV=#{rails_env}"
end
task :import_all do
run "cd #{release_path}; rake import:pages RAILS_ENV=#{rails_env}"
run "cd #{release_path}; rake import:legacy_all RAILS_ENV=#{rails_env}"
end
task :import_pages do
run "cd #{release_path}; rake import:pages RAILS_ENV=#{rails_env}"
end
end
namespace :rake do
desc "Run a task on a remote server."
# run like: cap staging rake:invoke task=a_certain_task
task :invoke do
run("cd #{deploy_to}/current; /usr/bin/env rake #{ENV['task']} RAILS_ENV=#{rails_env}")
end
end
But if I move the task :invoke into namespace :deploy, drop the namespace :rake, then everything is ok, it's so confusing..
This happen since Capistrano in its source declare rake as internal variable, in this way you can override which command is used as rake command line using a set :rake instruction in your deploy file.
However, because of capistrano internals, when you declare a rake namespace it will take precedence on the declared rake variable. So when capistrano execute its recipe to precompile assets and it builds the required command line the rake variable instead of returning the "rake" string returns your declared namespace converted to a string. You can see it in this part of the built command line:
... && #<Capistrano::Configuration::Namespaces::Namespace:0x007ff2b4a4bad8> RAILS_ENV=staging RAILS_GROUPS=assets assets:precompile'
This obviously cause a shell syntax error and this is the reason of why changing the namespace solves your issue.