Skip to content

Commit 3eb08a0

Browse files
Revert test style changes to ApplicationGenerator & MembershipService
1 parent 1530f99 commit 3eb08a0

File tree

3 files changed

+1
-111
lines changed

3 files changed

+1
-111
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: node_js
22
node_js:
33
- "6"
44
before_script:
5-
- make build
5+
- make build
66
# FIXME:
77
# This needs to be enabled again when we eliminate PhantomJS for Firefox
88
# Even the unit tests require a browser

test/spec/services/applicationGeneratorSpec.js

-67
Original file line numberDiff line numberDiff line change
@@ -255,73 +255,6 @@ describe("ApplicationGenerator", function(){
255255
});
256256

257257
it("should generate a BuildConfig for the source", function(){
258-
var generatedBuildConfig = resources.buildConfig;
259-
260-
// specific tests to ease pain in debugging
261-
expect(generatedBuildConfig.apiVersion).toEqual('v1');
262-
expect(generatedBuildConfig.kind).toEqual('BuildConfig');
263-
expect(generatedBuildConfig.metadata.name).toEqual('ruby-hello-world');
264-
expect(generatedBuildConfig.metadata.labels).toEqual({
265-
"foo" : "bar",
266-
"abc" : "xyz"
267-
});
268-
expect(generatedBuildConfig.metadata.annotations).toEqual({
269-
"openshift.io/generated-by": "OpenShiftWebConsole"
270-
});
271-
expect(generatedBuildConfig.spec.output).toEqual({
272-
"to": {
273-
"name": "ruby-hello-world:latest",
274-
"kind": "ImageStreamTag"
275-
}
276-
});
277-
expect(generatedBuildConfig.spec.source).toEqual({
278-
"git": {
279-
"ref": "master",
280-
"uri": "https://github.com/openshift/ruby-hello-world.git"
281-
},
282-
"type": "Git"
283-
});
284-
expect(generatedBuildConfig.spec.strategy.type).toEqual('Source');
285-
286-
expect(generatedBuildConfig.spec.strategy.sourceStrategy.from.kind).toEqual('ImageStreamTag');
287-
expect(generatedBuildConfig.spec.strategy.sourceStrategy.from.name).toEqual('origin-ruby-sample:latest');
288-
expect(generatedBuildConfig.spec.strategy.sourceStrategy.from).toEqual({
289-
"kind": "ImageStreamTag",
290-
"name": "origin-ruby-sample:latest"
291-
});
292-
expect(generatedBuildConfig.spec.strategy.sourceStrategy.env).toEqual([
293-
{
294-
"name": "BUILD_ENV_1",
295-
"value": "someValue"
296-
},
297-
{
298-
"name": "BUILD_ENV_2",
299-
"value": "anotherValue"
300-
}
301-
]);
302-
303-
expect(generatedBuildConfig.spec.triggers).toEqual([
304-
{
305-
"generic": {
306-
"secret": "secret101"
307-
},
308-
"type": "Generic"
309-
},
310-
{
311-
"github": {
312-
"secret": "secret101"
313-
},
314-
"type": "GitHub"
315-
},
316-
{
317-
"imageChange" : {},
318-
"type" : "ImageChange"
319-
},
320-
{
321-
"type": "ConfigChange"
322-
}
323-
]);
324-
325258
// the full output tree should match
326259
expect(resources.buildConfig).toEqual({
327260
"apiVersion": "v1",

test/spec/services/membership/membershipSpec.js

-43
Original file line numberDiff line numberDiff line change
@@ -237,49 +237,6 @@ describe('MembershipService', function() {
237237
// declaring intent, if not, this test will compare raw output.
238238
it('should build a map for the tabbed role list interface', function() {
239239

240-
var mappedRoleBindings = MembershipService.mapRolebindingsForUI(roleBindings, keyedRoles);
241-
var userBinding = mappedRoleBindings[0];
242-
var groupBinding = mappedRoleBindings[1];
243-
var serviceAccountBinding = mappedRoleBindings[2];
244-
var systemUserBinding = mappedRoleBindings[3];
245-
var systemGroupBinding = mappedRoleBindings[4];
246-
247-
// specific tests to ease pain in debugging
248-
expect(userBinding.kind).toEqual('User');
249-
expect(userBinding.sortOrder).toEqual(1);
250-
expect(userBinding.name).toEqual('User');
251-
expect(_.size(userBinding.subjects)).toEqual(2);
252-
expect(_.map(userBinding.subjects, 'name')).toEqual(['jill', 'jack']);
253-
expect( _.keys(userBinding.subjects['-jill'].roles) ).toEqual(['ClusterRole-admin', 'ClusterRole-view']);
254-
expect( _.map(userBinding.subjects['-jill'].roles, 'metadata.name') ).toEqual(['admin', 'view']);
255-
expect( _.keys(userBinding.subjects['-jack'].roles) ).toEqual(['ClusterRole-edit']);
256-
expect( _.map(userBinding.subjects['-jack'].roles, 'metadata.name') ).toEqual(['edit']);
257-
258-
expect(groupBinding).toEqual({
259-
kind: 'Group',
260-
sortOrder: 2,
261-
name: 'Group',
262-
subjects: {}
263-
});
264-
265-
expect(serviceAccountBinding.kind).toEqual('ServiceAccount');
266-
expect(serviceAccountBinding.sortOrder).toEqual(3);
267-
expect(serviceAccountBinding.description).toEqual('Service accounts provide a flexible way to control API access without sharing a regular user’s credentials.');
268-
expect(serviceAccountBinding.name).toEqual('ServiceAccount');
269-
expect(serviceAccountBinding.helpLinkKey).toEqual('service_accounts');
270-
expect(serviceAccountBinding.subjects['fake-project-foo'].name).toEqual('foo');
271-
expect(serviceAccountBinding.subjects['fake-project-foo'].namespace).toEqual('fake-project');
272-
273-
expect(systemUserBinding.kind).toEqual('SystemUser');
274-
expect(systemUserBinding.sortOrder).toEqual(4);
275-
expect(systemUserBinding.description).toEqual('System users are virtual users automatically provisioned by the system.');
276-
expect(systemUserBinding.helpLinkKey).toEqual('users_and_groups');
277-
278-
expect(systemGroupBinding.kind).toEqual('SystemGroup');
279-
expect(systemGroupBinding.sortOrder).toEqual(5);
280-
expect(systemGroupBinding.description).toEqual('System groups are virtual groups automatically provisioned by the system.');
281-
expect(systemGroupBinding.helpLinkKey).toEqual('users_and_groups');
282-
283240
// the full output tree should match
284241
expect(MembershipService.mapRolebindingsForUI(roleBindings, keyedRoles))
285242
.toEqual([{

0 commit comments

Comments
 (0)