[JIRA] (JENKINS-57691) GitLabAuthSourceTest fails

11 views
Skip to first unread message

parichay.barpanda@gmail.com (JIRA)

unread,
May 26, 2019, 4:05:02 PM5/26/19
to jenkinsc...@googlegroups.com
Parichay Barpanda created an issue
 
Jenkins / Improvement JENKINS-57691
GitLabAuthSourceTest fails
Issue Type: Improvement Improvement
Assignee: Parichay Barpanda
Components: gitlab-branch-source-plugin
Created: 2019-05-26 20:04
Labels: gsoc-2019
Priority: Critical Critical
Reporter: Parichay Barpanda

The test fails in `given_tokenCredentialwhenconvertthen_tokenAuth()` method of `GitLabAuthSourceTest` class.

This function is responsible for checking if the `GitLabAuth` object returned by `AuthenticationTokens.convert(GitLabAuth, PersonalAccessToken)` is actually an instance of `GitLabAuthToken`. But the object returned is null while `PersonalAccessToken` object is not null.

The error shown:

```

java.lang.AssertionError: java.lang.AssertionError: Expected: an instance of io.jenkins.plugins.gitlabbranchsource.client.api.GitLabAuthToken     but: null
{{ at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20) at org.junit.Assert.assertThat(Assert.java:956) at org.junit.Assert.assertThat(Assert.java:923) at io.jenkins.plugins.gitlabbranchsource.authentication.GitLabAuthSourceTest.given_tokenCredentialwhenconvertthen_tokenAuth(GitLabAuthSourceTest.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:548) at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298) at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.lang.Thread.run(Thread.java:748)}}

```

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

parichay.barpanda@gmail.com (JIRA)

unread,
May 26, 2019, 4:07:03 PM5/26/19
to jenkinsc...@googlegroups.com
Parichay Barpanda updated an issue
Change By: Parichay Barpanda
Sprint: GSoC 2019. Coding Phase 1 Community Bonding

parichay.barpanda@gmail.com (JIRA)

unread,
May 28, 2019, 2:45:02 PM5/28/19
to jenkinsc...@googlegroups.com
Parichay Barpanda commented on Improvement JENKINS-57691
 
Re: GitLabAuthSourceTest fails

The GitLabAuthToken was not annotated with Extension so the credentials plugin always returned `null` for the runtime initalisation.

parichay.barpanda@gmail.com (JIRA)

unread,
May 28, 2019, 2:45:02 PM5/28/19
to jenkinsc...@googlegroups.com
Parichay Barpanda started work on Improvement JENKINS-57691
 
Change By: Parichay Barpanda
Status: Open In Progress

parichay.barpanda@gmail.com (JIRA)

unread,
May 28, 2019, 2:46:03 PM5/28/19
to jenkinsc...@googlegroups.com
Parichay Barpanda updated Improvement JENKINS-57691
 

Solved after adding GitLabAuthToken class to Extension list.

Change By: Parichay Barpanda
Status: In Review Resolved
Resolution: Fixed

parichay.barpanda@gmail.com (JIRA)

unread,
May 28, 2019, 2:46:04 PM5/28/19
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages