Skip to content
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

Use basic auth instead of JWT in tests. #1141

Merged
merged 5 commits into from Jun 12, 2017
Merged

Conversation

imeredith
Copy link
Collaborator

Description

@vivek seeing occasionally flaky tests that I believe are due to JWT not setting the user properly. Will be documenting it in a ticket for you to take a look at

See JENKINS-XXXXX.

Submitter checklist

  • Link to JIRA ticket in description, if appropriate.
  • Change is code complete and matches issue description
  • Appropriate unit or acceptance tests or explanation to why this change has no tests
  • Reviewer's manual test instructions provided in PR description. See Reviewer's first task below.
  • Ran Acceptance Test Harness against PR changes.

Reviewer checklist

  • Run the changes and verified the change matches the issue description
  • Reviewed the code
  • Verified that the appropriate tests have been written or valid explanation given

@@ -365,7 +365,7 @@ public void badTokenTest1() throws Exception {
}


@Test
//@Test
Copy link
Contributor

Choose a reason for hiding this comment

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

Should @Ignore be used so we can see in reports that they are actually skipped?

Copy link
Collaborator

@vivek vivek left a comment

Choose a reason for hiding this comment

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

@imeredith Can we try something simple first, that is move System.setProperty("BLUEOCEAN_FEATURE_JWT_AUTHENTICATION", "true"); in static initializer. Something like:

static {
        System.setProperty("BLUEOCEAN_FEATURE_JWT_AUTHENTICATION", "true");
}

This will clear up any race condition that might be causing it not set at runtime?

@imeredith
Copy link
Collaborator Author

I am trying that but i dont see how that can fix anything given we set that prop in BaseTest

  public BaseTest() {
        System.setProperty("BLUEOCEAN_FEATURE_JWT_AUTHENTICATION", "true");
        j = new JenkinsRule();
    }

@vivek
Copy link
Collaborator

vivek commented Jun 9, 2017

@imeredith thats inside constructor, static blocks are loaded during class load time and much before JenkinsRule or anything else gets setup. I think it's worth a shot.

@imeredith
Copy link
Collaborator Author

@vivek That static block thing didnt work. Merging this for now because it is blocking other people from getting things done. Can we add them back in if we figure it out.

@imeredith imeredith merged commit e6f4703 into master Jun 12, 2017
@vivek
Copy link
Collaborator

vivek commented Jun 12, 2017

@imeredith 👍

i386 pushed a commit that referenced this pull request Jun 12, 2017
* Remove JWT token from profile tests

* remove use jwt flag

* fix more tests

* Use @ignore for skipped tests

(cherry picked from commit e6f4703)
@i386
Copy link
Contributor

i386 commented Jun 12, 2017

Cherry picked to release branch

@i386 i386 deleted the remove_jwt_from_tests branch June 12, 2017 23:38
EvilBeaver added a commit to EvilBeaver/blueocean-plugin that referenced this pull request Jun 20, 2017
* this may solve something (jenkinsci#1112)

* [maven-release-plugin] prepare release blueocean-parent-1.1.0-beta-9

* [maven-release-plugin] prepare for next development iteration

* Enable the use of multiple Jenkins versions (jenkinsci#1114)

* JENKINS-37324# Step description feature (jenkinsci#1005)

* JENKINS-37324# Step description feature

* Upgraded workflow-cps to alpha2.

* Return step description in separate method

Step title is now step.displayName + ": " + step.displayDescription

* Fixed failing test

* Updated to latest changes

* Updated workflow apis to released versions

* step descriptions now more robust

* Use git tests jar for GitSampleRepoRule (jenkinsci#1115)

It fixes the issue of missing user.name, user.email.

* try this out (jenkinsci#1117)

* Improved Webdriver lifecycle. (jenkinsci#1118)

* Improved Webdriver lifecycle.

A new webdriver instance is created and cleaned up before and after each test method now.

* Try Screenshotting

* Remove test test method

* JENKINS-44644# Fix for custom org sse events for activity screen (jenkinsci#1119)

* JENKINS-44631# Fix to show organization name on Dashboard (jenkinsci#1121)

If blueocean dashboard is accessed in context of organization route it
always showed organizations ignoring organizations.emabled flag. This
fix encorces this flag to show organization name on dashboard.

* upgrade to favorite 2.2.0 (jenkinsci#1113)

* upgrade to favorite 2.1.0

* Update pom.xml

* Update pom.xml (jenkinsci#1123)

* Bug/jenkins 43926 loading worm turns white too early (jenkinsci#1127)

* fix loading worm being completed by i18n before the extensions start loading

* release beta version of corejs

* Change version to 1.2.0-beta-1-SNAPSHOT (jenkinsci#1128)

* 1.2 dependency upgrade (jenkinsci#1103)

* fix RunDetailsHeader showing "Pull Request" in header for non-multibranch jobs, also fix PRs showing double pop-up buttons (jenkinsci#1125)

* Wrong imported class (jenkinsci#1124)

* Hotfix/loading worm fix corejs (jenkinsci#1129)

* release blueocean-core-js 0.0.115

* tick up blueocean-core-js version

* tick up blueocean-core-js versions in other modules

* Task/jenkins 37324 step description (jenkinsci#1126)

* add (failing) test to check that step name and description are both available on model object

* pass "displayDescription" through to model

* display name and description alongside; uses primitive truncation for name that doesn't include ellipsis

* update ATH to reflect new DOM structure for log console's step header name / description

* [JENKINS-44725] Move UserStatePreloader to a more appropiate location (jenkinsci#1130)

* JENKINS-44624# Fix to avoid multiple open blueocean menu (jenkinsci#1122)

When there are more than one implementation of BlueOceanActionUrl which
implements RootAction, there would (of course) be multiple menu items on
the left menu.

This fix changes the abstraction where BlueOceanUrlAction is a final
class and BlueOceanUrlObjectFactory is factory of BlueOceanUrlObject,
which defines properties to render 'Open Blue Ocean' left side menu.

* JENKINS-38982 fast search (jenkinsci#1043)

* partial implementation for JENKINS-38982

* add styles to the search pipeline input, add icon and remove the obsolete organizationPipelines method

* remove allPipelinesPager method and code cleanup

* release beta version of corejs

* add Java tests

* Add glob matcher to Pipeline search

* Allow equality matches

* javadoc

* more tests

* Add oro as dependency

* add path match test for lower case

* Move oro dependency to root pom

* Add search test for glob syntax

* revert PipelineSearch.java changes

* use send regex instead of search query, use lodash debounce, replace base64 search icon with material design one

* Only render components after CSS <link> elements are fully laoded

* js-extensions 0.0.36-tf-beta1

* js-extensions 0.0.36-Nicu-beta1

* npm install @jenkins-cd/js-extensions@0.0.36-Nicu-beta1 -S -E on core-js

* core-js 0.0.113-Nicu-beta1

* npm install @jenkins-cd/js-extensions@0.0.36-Nicu-beta1 @jenkins-cd/blueocean-core-js@0.0.113-Nicu-beta1 -S -E on dependants

* added check missing in ResourceLoadTracker._addCSS

* add organization back to search, fix glob match criteria

* release beta version of corejs

* new version of corejs and jdl

* make search input change the url

* hide fast search behind the "fastsearch" feature flag get param

* fix flash of unstyled content for the search box

* release corejs beta

* fix lint errors

* fix failing tests

* release corejs beta

* release corejs and js-extensions beta

* add invisible text that will cause fonts to load immediately, move srollbar visibility code to corejs so it loads immediately and not cause content to shift

* update failing tests

* Search API enhancements (jenkinsci#1102)

* Bring back the equality check

* Ensure that use cases identified in search requirements can be run against search api

See https://docs.google.com/a/cloudbees.com/document/d/1riU62MGFF7A9cInJx04gIwZQ8PGwN9MkQQORC3dGq40/edit?usp=sharing

* .

* .

* Review feedback

* fix core-js shrinkwrap with beta version of js-extensions

* move updateGetParam to separate util file

* use native input element instead of the JDL TextInput component

* hide favorites if searching

* fix lint errors

* fix url searchTextQuery, user regEx instead of regular replace

* remove feature flag requirement for fast search

* fix debouncer, add no results found message, implement other suggestions

* release new version of corejs and js-extensions

* fix issue with mismatched version of js-extensions in blueocean-core-js

* fix lint errors

* revert js-extensions changes that broke the build (jenkinsci#1132)

* JENKINS-44736 - Fix for unstable status (jenkinsci#1135)

* Upgrade favorite plugin for security issue for 1.2 (jenkinsci#1134)

* encode search string when pushing it to the url string (jenkinsci#1137)

* JENKINS-44742 fix issue where step with block failure log appended is… (jenkinsci#1136)

* Translation files

* JENKINS-44625# Fix for exit and cog wheel links with custom organization (jenkinsci#1120)

* JENKINS-44625# Fix for exit and cog wheel links with custom organization

* Fixed buildClassicConfigUrl() as jobPrefixPath() returns value with '/' as prefix and suffix

* Take org group in to account to compute exit to classic and config

* upgraded to latest blueocean-core-js version

* blueocean-core-js release dance

* Fix for failing ATH test

For default, jekins org, no prefix needed. Also released next version of
blueocean-core-js

* Add support for alternative Github API endpoints

* Bug/jenkins 43907 creation console error (jenkinsci#1140)

* fix bug where SSE handler was trying to fetch a run for an event actually related to repo/branch scanning: just ignore it

* add a faster build option for core-js

* release new beta core-js

* use new beta core-js in dependent modules

* release blueocean-core-js 0.0.121

* update dependent modules to use blueocean-core-js@0.0.121

* Use basic auth instead of JWT in tests. (jenkinsci#1141)

* Remove JWT token from profile tests

* remove use jwt flag

* fix more tests

* Use @ignore for skipped tests

* Bug/jenkins 44760 search is missing the clear button (jenkinsci#1138)

* add fastsearch clear button

* release beta version of corejs

* release new version of corejs

* [FIX JENKINS-44595] - Use Organization Display Name (jenkinsci#1144)

* [FIX JENKINS-44595] - Use Organization Display Name

* [FIX JENKINS-44595] - Change condition

* [JENKINS-44595] publish core-js and do the version dance

* [JENKINS-44595] - Remove left line

* [JENKINS-44595] - Fix run details organization display name

* [JENKINS-44595] - Fix favorites organization display name

* [FIX JENKINS-44595] - Missing semi-colon

* [master] version dance

* Task/jenkins 43083 testing improvements (jenkinsci#1002)

* [JENKINS-43083] add support for testing via jest with "npm run test"

* [JENKINS-43083] run jest via gulp instead

* [JENKINS-43083] add junit reporting; provide two different tasks for running jest: one with coverage and test reports output, another simpler one for dev

* [JENKINS-43083] ensure failed test breaks build

* [JENKINS-43083] ensure unhandled error breaks build

* [JENKINS-43083] remove failure

* [JENKINS-43083] support "test" "test-fast" and "test-debug" npm scripts; add support for supplying test name to "fast" and "debug" tasks; configure the test reports location via environment variable, rather than moving the file over

* [JENKINS-43083] refactor code to use "runJest" function which adds proper error handling and "--test" argument handling in all test run scenarios

* [JENKINS-43083] docs about tests

* [JENKINS-43083] use Jest mocking to provide a "no-op" implementation of i18n for the React component unit tests that rely on it

* [JENKINS-43083] switch from "before" to "beforeAll"

* [JENKINS-43083] WIP for running jjsbuilder tests with Jest; still needs real publish "js-builder-jest" plugin to be made available

* [JENKINS-43083] ignore jest reports

* [JENKINS-43083] dashboard uses Jest and minor tweaks to use "beforeAll"

* [JENKINS-43083] export a named function to avoid test breakage when using istanbul for coverage

* [JENKINS-43083] personalization uses Jest; use different approach to mocking i18n

* [JENKINS-43083] eliminate obsolete mocking code that is no longer needed

* [JENKINS-43083] typo in coverage dir name

* [JENKINS-43083] use i18n mock in TimeHarmonizer

* [JENKINS-43083] fix weird package.json / shrink entry for js-builder-jest

* fix test that was intentionally failing

* invoke gulp natively (bypassing jjsb command line) to facilitate debugging of unit tests; pull in new version of js-builder-jest that supports "test:debug"

* update shrinkwrap to include jest and related libs

* experiment with adding jest junit reports

* align run script naming w/ dashboard and personalization

* verify that core-js tests are being picked up

* re-enable test

* JENKINS-44865 add english translation for rundetail.tests.results.fixed

* fix official Docker image (jenkinsci#1148)

install-plugins.sh script downloads a too recent version of workflow-job
let's force it to latest compatible version with 2.46 LTS to quickly fix
the Official image

* add a parameter to rebuild the last official Docker image (jenkinsci#1151)

In case it's broken

* WIP Tables update (jenkinsci#1028)

* Update table design for Pipelines, Actions, and Branches for #JENKINS-41833

From branch  josh/jenkins-41833-new-table-migration-2

* Small editorial / typo fixes (jenkinsci#1156)

* Add pipeline build and milestone steps to aggregator (jenkinsci#1155)

* remove instructions about running ATH from pull request template, as this is done for all CI builds now anyways (jenkinsci#1154)

* Bump Jenkins minimum to 2.7.4 (jenkinsci#1159)

* Bump Jenkins minimum to 2.7.4

workflow-cps now depends on this version and prevent a successful install on 2.7.1

* Default Jenkins version of ATH is 2.7.4

* JENKINS-44926 prevent stackoverflow in TryBlueOceanMenu (jenkinsci#1164)

(cherry picked from commit ac10662)

* [JENKINS-44881] ignore refresh header for i18n (jenkinsci#1153)

* Ignore refresh headers for i18n

* Release beta core-js

* Release core-js

* Release core-js

* JENKINS-44867# PR tab regression fix (jenkinsci#1149)

* JENKINS-44867# PR tab regression fix

Added pagination to ContainerFilter to avoid checking for PR action only
till page size numbers are collected.

* Added test

(cherry picked from commit 6d34964)

* change the icon for the "go to classic" link, drop the "go to" from the link text (jenkinsci#1158)

* Performance - cache PR and branch metadata lookup (jenkinsci#1150)

* Cache branch and PR objects

* .

* Replace caching impl with a better one

* add tests

* switch to getItemByFullName

* Added configurable maximum size of cache

* [JENKINS-44866] Make the history button a component (jenkinsci#1147)

* Make the history button a component

* Fix linting

* Add ATH test

* Bug/jenkins 44759 remove search query param 2 (jenkinsci#1160)

* bug/JENKINS-44759-remove-search-query-param-2 * Import Cliff's test updates

* bug/JENKINS-44759-remove-search-query-param-2 * Manually re-apply Cliff's fixes

* bug/JENKINS-44759-remove-search-query-param-2 * Adjust the Dashboard page object to use new selectors

* Fix flaky testNewPipelineQueueItem (jenkinsci#1166)

* Fix flakey getPipelineRunsStopTest (jenkinsci#1168)

* Dependency updates (jenkinsci#1169)

* Update pom.xml

* Update pom.xml

* Topic/give more time for queue to process (jenkinsci#1171)

* Fix flakey testNewPipelineQueueItem

* add some comments

* orify

* remove redundant assertions and stabilise abort test (jenkinsci#1172)

* this is getting annoying

* removing a redundant assertion that was race prone

* Terms changed

* Untranslated keys removed

* Bug/jenkins 44105 branch filter typography (jenkinsci#1162)

* bug/JENKINS-44105-branch-filter-typography * Put the branch column filter in a non-header cell, and mess with the styles a bit to neaten it up and match the designs

* Lint

* @jenkins-cd/blueocean-core-js@0.0.124

* bug/JENKINS-44105-branch-filter-typography * Update deps for core-js and JDL, bump core-js v

* bug/JENKINS-44105-branch-filter-typography Re-publish and re-import core-js so they have the same JDL ver

* <brockman> that oughtta hold those SOBs </brockman>

* bug/JENKINS-44105-branch-filter-typography * Reinstall stuff, hope for the best

* Upgrade to declarative 1.1.6 (jenkinsci#1173)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants