-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to detect ciBuildId for Jenkins or run in --parallel #2346
Comments
I have the exact same issue. I'm thinking the issue is more in Docker When I do
And have some docker images running
I get no parallelization occuring |
For the comment about the Branch/Author/Commit/Message/CI not being populated in the dashboard, this looks like the reason for author and message: https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/util/ci_provider.coffee#L241 |
Some more info. From https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/util/ci_provider.coffee#L20 it looks like if I pass the
|
@drewbrend Yeah - this is the error when we cannot get the CI Build id from the CI provider essentially. It looks like we are looking for these env vars from Jenkins to determine this ourselves: https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/util/ci_provider.coffee#L129 |
Ahhh thank you! I passed those into my container via the Some docs around what env vars Cypress uses would be very useful so we know which ones to provide to a docker container. I still don't have Author, Commit, or Message populated in the dashboard, so that needs work. And still need to work with someone to get parallelization working. |
I spent a good deal of time on this but have parallelization working across multiple nodes in Jenkins, running in docker containers. Here's what I did for anyone who stumbles on this in the future. This assumes you already have cypress running successfully in a Jenkins job. Sign up for the cypress dashboard, this is required for parallelization. Follow cypress docs on how to get your project reporting to the dashboard, it's easy, I won't explain it. In Jenkins I created a The runner job does basically what you already have set up to run serially, except it also passes these flags to the cypress run command: The dispatcher job passes the same CI_BUILD_ID parameter to the runner jobs, this needs to be a key that is unique to each run of the dispatcher, so I used the env variable BUILD_NUMBER. |
So now that the parallelization is resolved, the only things outstanding for this ticket are the git details not being reported to the dashboard, which will require changes in Cypress: -Author |
@drewbrend thanks so much for this! We are putting a fix for commit information here #2345 so that hopefully fills the missing fields |
also @drewbrend can you list all environment variables from a few CI boxes that run in parallel (hiding or removing sensitive keys) - maybe there is something in common that Jenkins already puts for you? |
Sure thing, these is the dump from the Box#1:
Box#2:
|
@drewbrend to get the git info, do you think this would work
The only one missing is from these vars
|
I see how |
@bahmutov The If you can do something similar to what I have below in cypress before you pass the infomation to the dashboard, I think that could work for the Git info. I imagine you could do the same to get This shell is in my
|
hmm, we do use https://github.com/cypress-io/commit-info to fetch Git things https://github.com/cypress-io/commit-info/blob/418002428b653ed75ccd82bff6966529c9009e24/src/git-api.js#L9 but we do NOT pass would |
If you're not passing I am running |
could you add just |
@bahmutov I changed |
Hmm, ok @drewbrend if you can have another env variable |
@bahmutov I set that, and the printenv command shows |
@drewbrend ughh, we are hiding DEBUG output from stderr, that's unfortunate. I will need to think of the way to debug this |
@bahmutov I'm happy to help, let me know what you need. I'll have time this evening to run a couple tests if you think of anything to try. |
Great @drewbrend so one thing you might do is to look at the code in https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/util/ci_provider.coffee and enable debug logs for it to see the commit information in
DEBUG=cypress:server is set
and here is where it is called
which is logged using if we can see what each part does we could determine where things go wrong ... |
@bahmutov I have |
Hmm, we might have added more debug log output after 3.1.0 to actually debug this problem better |
Okay no problem. It isn't a blocker for me, but would be nice to have. We have parallel working and with our setup we can pretty easily figure out the author and commit from the branch name if we need to. |
Great, yeah, if you got it working - that is nice, and if this is not a blocker, than perfect, and next release hopefully will have all the information either fixed or able to debug. I have installed local Jenkins in Docker setup https://hub.docker.com/r/jenkinsci/blueocean/ --- and could not get Node plugin to actually add Node there :( https://medium.com/wearetheledger/jenkins-your-butler-for-continuous-integration-blue-ocean-docker-image-solution-to-node-not-ebf9ebfbfa78 Plus we really want a public Jenkins instance that can show to everyone the build results and pipeline for our cypress-example-kitchensink, so Jenkins CI demo is still work in progress. |
Closing as resolved. Please comment if you are still having this issue and we will consider reopening. |
This issue stemmed out of a conversion with @bahmutov on gitter
Current behavior:
Running my specs in Jenkins I get this error:
If I add
--ci-build-id ${BUILD_NUMBER}
to the run command my test will run and report to the dashboard, however the values for Brach/Author/Commit/Message/CI are not populated in the dashboard, they show "unknown", and I am only running on one executor - not in parallel.I am running inside a docker container, I think this may be part of the issues I am having and I may have to explicitly expose the environment variables that Cypress uses to my container. However, I do not know what environment variables Cypress needs to figure this all out.
Desired behavior:
Cypress should detect Jenkins and all environment variables automatically
Steps to reproduce:
Run Cypress specs in a docker container in Jenkins with the
--parallel
flag specified. I am on v1.642.4Versions
Cypress 3.1.0
Jenkins 1.642.4
Electron 59
The text was updated successfully, but these errors were encountered: