I am running 4 test suite and a databaseInterface file in jenkins. But jenkins is taking dramatic time to execute
I have started the job at 22:32:08 and its' 00:41:35. only 9 test cases has executed.
00:49:05 [2022-07-20T00:49:05.419] Test Suites/PDEPF/PDEPFCollection - 20220719_223230...................11/91(12%)
00:49:05 [2022-07-20T00:49:05.419] --------------------------------------------------------------------------------
00:49:05 [2022-07-20T00:49:05.419] Test Suites/PDEPF/PDEPFSuite1 - Chrome - 20220719_223235................2/23(9%)
00:49:05 [2022-07-20T00:49:05.419] Test Suites/PDEPF/PDEPFSuite2 - Chrome - 20220719_223240...............3/23(13%)
00:49:05 [2022-07-20T00:49:05.419] Test Suites/PDEPF/PDEPFSuite3 - Chrome - 20220719_223245................2/22(9%)
00:49:05 [2022-07-20T00:49:05.420] Test Suites/PDEPF/PDEPFSuite4 - Chrome - 20220719_223250...............3/22(14%)
00:49:05 [2022-07-20T00:49:05.420] Test Suites/PDEDBSuiteInterface - Chrome - 20220719_223255.............1/1(100%)
But in previous run job started at 06:40:31 and after 2 hours 40 test cases has already ran.
08:40:52 [2022-07-08T08:40:52.113] Test Suites/PDEPKG/PDEPKGCollection - 20220708_064139.................40/91(44%)
08:40:52 [2022-07-08T08:40:52.114] --------------------------------------------------------------------------------
08:40:52 [2022-07-08T08:40:52.114] Test Suites/PDEPKG/PDEPKGSuite1 - Chrome - 20220708_064147.............9/23(39%)
08:40:52 [2022-07-08T08:40:52.115] Test Suites/PDEPKG/PDEPKGSuite2 - Chrome - 20220708_064153............10/23(43%)
08:40:52 [2022-07-08T08:40:52.115] Test Suites/PDEPKG/PDEPKGSuite3 - Chrome - 20220708_064159............10/22(45%)
08:40:52 [2022-07-08T08:40:52.116] Test Suites/PDEPKG/PDEPKGSuite4 - Chrome - 20220708_064206............10/22(45%)
08:40:52 [2022-07-08T08:40:52.116] Test Suites/PDEDBSuiteInterface - Chrome - 20220708_064211.............1/1(100%)
How can I troubleshoot the reason for the slow?
Related
I am new to circleci so not sure how to use an orb. Couldn't find a good example documetation. The orb in question is this https://circleci.com/developer/orbs/orb/ganezasan/auto-cancel-workflow
The idea is that circleci should be able to cancel other josb whose tests are failed. Instead of re-inventing the wheel, i found this orb but couldn't find a sample config.yml file.
How can i use this orb in my existing config.yml file?
The orb page you linked provides a usage example:
jobs:
failed-job:
docker:
- image: 'cimg/base:stable'
steps:
- run: sleep 30 && exit 1
success-job-1:
docker:
- image: 'cimg/base:stable'
steps:
- run: sleep 60
success-job-2:
docker:
- image: 'cimg/base:stable'
steps:
- run: sleep 60
orbs:
auto-cancel: ganezasan/auto-cancel-workflow#0.0.7
version: 2.1
workflows:
cancel-workflow:
jobs:
- success-job-1
- success-job-2
- failed-job
- auto-cancel/auto-cancel:
api_token: CIRCLE_TOKEN
interval_seconds: 10
But basically. You need to add the orb to your config.yml using this code block
orbs:
auto-cancel: ganezasan/auto-cancel-workflow#0.0.7
and then you need to add this job to your workflow
- auto-cancel/auto-cancel:
api_token: CIRCLE_TOKEN
interval_seconds: 10
and then you need to make sure you have an environment variable added to your project called CIRCLE_TOKEN with the value set to a CircleCI API token that you can generate under User Settings > Personal API Tokens.
But rather than using this orb you may want to look at running your jobs in series using requires. In the workflow below if test1 fails both test2 and deploy will be skipped. If test 1 is successful, test2 will run. If test2 fails then deploy will be skipped.
workflows:
version: 2
build-test-and-deploy:
jobs:
- build
- test1:
requires:
- build
- test2:
requires:
- test1
- deploy:
requires:
- test2
I am able to run the protractor using command prompt.
However, when I try to run protractor using jenkins, it started the selenium server but does not execute the browser and will fail due to timeout.
Is there any configuration that I need to do at jenkins side aside from the project path?
I also have tried to install the package manually to makesure its updated.
Below is the error when I try to build/run protractor using jenkins:
> webhis_jasmine# protractor C:\Users\user1\.jenkins\HISWEBJASMINE
> protractor conf.js
[12:06:44] I/launcher - Running 1 instances of WebDriver
[12:06:44] I/local - Starting selenium standalone server...
[12:06:46] I/local - Selenium standalone server started at http://10.190.40.39:56419/wd/hub
Started
[31mF[0mA Jasmine spec timed out. Resetting the WebDriver Control Flow.
A Jasmine spec timed out. Resetting the WebDriver Control Flow.
[31mF[0mA Jasmine spec timed out. Resetting the WebDriver Control Flow.
[31mF[0m[31mF[0m[31mF[0m[31mF[0m[31mF[0m[31mF[0m[31mF[0m[31mF[0m[31mF[0m[31mF[0m[31mF[0m[31mF[0m[31mF[0m[31mF[0m[31mF[0m[31mF[0m[31mF[0m[31mF[0m[31mF[0m[31mF[0m
i tried to run webdriver-manager update only using jenkins just to check and it is giving below error:
C:\Users\user1\.jenkins\HISWEBJASMINE>webdriver-manager update
'webdriver-manager' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\user1\.jenkins\HISWEBJASMINE>exit 9009
Here is config file:
// conf.js
var Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter');
exports.config = {
capabilities: {
'browserName': 'chrome'
},
specs: ['Patient_positive.js','Visit_positive.js'],
suites:{
Smoke: ['ChainLocators.js', 'Dropdown.js'],
Regression: 'ElementBasics.js',
Testbed: 'testbed.js',
PatientPositive: 'Patient_positive.js',
PatientNegative: 'Patient_negative.js',
VisitPositive: 'Visit_positive.js',
VisitNegative: 'Visit_negative.js',
EpisodeCPOEPositive: 'EpisodeCPOE_positive.js'
},
onPrepare:function(){
browser.driver.manage().window().maximize();
jasmine.getEnv().addReporter(
new Jasmine2HtmlReporter({
savePath: './test/reports/',
screenshotsFolder: 'images',
takeScreenshots: true,
fixedScreenshotName: true,
takeScreenshotsOnlyOnFailures: false,
cleanDestination: false,
showPassed: true,
fileName: 'Test_Report',
fileNameSuffix: '',
fileNameDateSuffix: true
})
);
},
jasmineNodeOpts:{
showColors: true
}
};
Is it related?
Update: I strip the spec to have to only 1 'it' and run. Manage to get a success result and report is generated, but i see the browser not launched as when running using cmd prompt.
C:\Users\hafizan.abdmulok\.jenkins\HISWEBJASMINE>npm run protractor
> webhis_jasmine# protractor C:\Users\hafizan.abdmulok\.jenkins\HISWEBJASMINE
> protractor conf.js
[15:14:40] I/launcher - Running 1 instances of WebDriver
[15:14:40] I/local - Starting selenium standalone server...
[15:14:43] I/local - Selenium standalone server started at http://10.190.40.39:52793/wd/hub
Started
Successfully open patient page
Successfully enter name
Successfully select title
Successfully select gender
Successfully enter date of birth
Successfully select ID type
Successfully enter idno= 850921141112
Successfully select Nationality= Malaysia
Successfully enter mobile no
Successfully enter patient address line 1
Successfully enter patient address line 2
Successfully enter patient address line 3
Successfully enter patient postcode= 57000
Successfully enter patient city= Bukit Jalil
Successfully select patient State= Kuala Lumpur
Successfully select patient State= Malaysia
[32m.[0m
1 spec, 0 failures
Finished in 63.169 seconds
CGM
[15:15:52] I/local - Shutting down selenium standalone server.
[15:15:52] I/launcher - 0 instance(s) of WebDriver still running
[15:15:52] I/launcher - chrome #01 passed
Finished: SUCCESS
Try using directConnect:true in your config file instead of seleniumAddress: 'http://localhost:4444/wd/hub',
before runing the test do the below activities
webdriver-manager clean
node node_modules/protractor/bin/webdriver-manager update --standalone --versions.standalone=3.8.0
Hope it helps you
I'm following this tutorial using their own sample repository that I forked from GitHub: https://discuss.bitrise.io/t/how-to-do-calabash-uitesting-on-bitrise/361 I'm not doing anything special or anything different than the tutorial.
I managed to get the APK and Android UI test working using calabash. But for some reason the APP for iOS is not in the artifacts despite it says it built it and the UI tests (also with calabash) are failing.
Cucumber Features
1 scenario (1 failed)
4 steps (4 skipped)
Finished in 6m22.928s seconds
Expand All
Collapse All
Feature: Sample Feature
features/sample.feature:3
Scenario: Sample Scenario
Could not connect to the DeviceAgent service.
device: #<Simulator: iPhone 6 (11.4) FDAAB45E-52F1-4133-A02D-632AA6A9A369 x86_64>
url: http://127.0.0.1:27753/
To diagnose the problem tail the launcher log file:
$ tail -1000 -F /Users/vagrant/.calabash/iOSDeviceManager/logs/current.log
./features/support/01_launch.rb:27:in `Before'
25 }
26
27 launcher.relaunch(options)
28end
29
30# gem install syntax to get syntax highlighting
Given the app has launched
features/steps/sample_steps.rb:1
And I have done a specific thing
features/steps/sample_steps.rb:7
When I do something
features/steps/sample_steps.rb:32
Then something should happen
features/steps/sample_steps.rb:41
Here is the bitrise.yml:
---
format_version: '5'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: xamarin
trigger_map:
- push_branch: "*"
workflow: primary
- pull_request_source_branch: "*"
workflow: primary
workflows:
primary:
steps:
- activate-ssh-key#3.1.1:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone#4.0.11: {}
- script#1.1.5:
title: Do anything with Script step
- certificate-and-profile-installer#1.9.3: {}
- nuget-restore#1.0.7: {}
- xamarin-archive#1.5.0:
inputs:
- xamarin_solution: "$BITRISE_PROJECT_PATH"
- xamarin_configuration: "$BITRISE_XAMARIN_CONFIGURATION"
- xamarin_platform: "$BITRISE_XAMARIN_PLATFORM"
- calabash-ios-uitest#1.3.1:
inputs:
- work_dir: "./iOS"
- deploy-to-bitrise-io#1.3.12: {}
- create-android-emulator#1.1.5:
inputs:
- name: FOO
- start-android-emulator#1.3.2: {}
- calabash-android-uitest#1.2.1:
inputs:
- work_dir: "./Droid"
app:
envs:
- opts:
is_expand: false
BITRISE_PROJECT_PATH: Multiplatform.sln
- opts:
is_expand: false
BITRISE_XAMARIN_CONFIGURATION: calabash
- opts:
is_expand: false
BITRISE_XAMARIN_PLATFORM: Any CPU
I asked the people from Bitrise and apparently calabsh-ios support Xcode 6 and 7 which are old and Bitrise doesn't provide a stack for that version.
https://github.com/calabash/calabash-ios
I'm trying to set allow_failures for a complex build process, but unfortunately it isn't working.
The problem is that in my env I am setting multiple environment variables, and cannot get Travis to recognise that I want on of these rows to be allowed to fail.
The documentation on allow_failures shows how to allow a single env to fail, along with another configuration option, but doesn't cover how to allow a multiple enviroment variable setup to fail.
The troublesome sections of the .travis.yml file are below:
env:
- DJANGO_VERSION='1.8,<1.9' DB=sqlitefile SEARCH=whoosh
- DJANGO_VERSION='1.8,<1.9' DB=postgres SEARCH=whoosh
- DJANGO_VERSION='1.8,<1.9' DB=mysql SEARCH=whoosh
- DJANGO_VERSION='1.8,<1.9' DB=sqlitefile SEARCH=elasticsearch
- DJANGO_VERSION='1.8,<1.9' DB=postgres SEARCH=elasticsearch
- DJANGO_VERSION='1.8,<1.9' DB=mysql SEARCH=elasticsearch
matrix:
allow_failures:
- env: DJANGO_VERSION='1.8,<1.9' DB=mysql SEARCH=elasticsearch
- env: DJANGO_VERSION='1.8,<1.9' DB=mysql SEARCH=whoosh
How can I do this?
Fixed!
Travis allow_failure options must be identical down to the whitespace!
So this won't work:
env:
- FOO='one' BAR='two'
- FOO='three' BAR='four'
matrix:
allow_failures:
- env: FOO='one' BAR='two'
But this will:
env:
- FOO='one' BAR='two'
- FOO='three' BAR='four'
matrix:
allow_failures:
- env: FOO='one' BAR='two'
Alright-- so there are a lot of similar questions regarding Polymer after dart2js. I am seemingly running into an issue that's specific to doing this but also running it as a Chrome app.
I have discovered that the outcome varies depending on the order of the transformers (which is expected).
Here's my results so far:
transformers:
- chrome
- polymer:
entry_points: web/example.html
csp: true
- $dart2js:
csp: true
This works great in browser but fails when run as a Chrome app.
Error: Uncaught TypeError: Cannot read property 'apply' of undefined (in the example.html_bootstrap.dart.js file)
From this point I am removing the chrome transformer because it's redundant.
Now I will switch the order of the transformers:
transformers:
- $dart2js:
csp: true
- polymer:
entry_points: web/example.html
csp: true
This fails when run in the browser.
Error: example.html_bootstrap.dart.js net::ERR_FILE_NOT_FOUND
This also fails when run as a Chrome app (with the same error).
Now I try to replicate what the guys on the CDE team are doing. Taking out the $dart2js transformer entirely.
https://github.com/dart-lang/chromedeveditor/blob/master/ide/pubspec.yaml
transformers:
- polymer:
entry_points: web/example.html
csp: true
This runs perfectly from the browser.
This fails when run as a Chrome app.
Error: blah blah violates CSP policy with unsafe-eval
Just to cover my bases I also tried this (fails CSP policy):
- chrome
- polymer:
entry_points: web/example.html
csp: true
and this (fails CSP policy):
- polymer:
entry_points: web/example.html
csp: true
- chrome
I think you can omit the chrome transformer when you use Polymer and $dart2js should be the last transformer.
csp_fixer is supposed to fix remaining issues.