Skip to content

Commit

Permalink
Bug 1517863 - show filename as top-level suite in each test
Browse files Browse the repository at this point in the history
This is quite handy in figuring out where to find a failing test case!
  • Loading branch information
djmitche committed Apr 3, 2019
1 parent fa98fdd commit c7f0640
Show file tree
Hide file tree
Showing 155 changed files with 1,136 additions and 1,074 deletions.
15 changes: 8 additions & 7 deletions clients/client/test/client_test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
suite('client requests/responses', function() {
let taskcluster = require('../');
let assert = require('assert');
let path = require('path');
let nock = require('nock');
let MonitorManager = require('taskcluster-lib-monitor');

const taskcluster = require('../');
const assert = require('assert');
const path = require('path');
const nock = require('nock');
const MonitorManager = require('taskcluster-lib-monitor');
const testing = require('taskcluster-lib-testing');

suite(testing.suiteName(), function() {
// This suite exercises the request and response functionality of
// the client against a totally fake service defined by this reference
// and implemented via Nock.
Expand Down
9 changes: 5 additions & 4 deletions clients/client/test/credinfo_test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
suite('taskcluster.credentialInfo', function() {
let taskcluster = require('../');
let assert = require('assert');
let nock = require('nock');
const taskcluster = require('../');
const assert = require('assert');
const nock = require('nock');
const testing = require('taskcluster-lib-testing');

suite(testing.suiteName(), function() {
teardown(function() {
assert(nock.isDone());
nock.cleanAll();
Expand Down
11 changes: 6 additions & 5 deletions clients/client/test/creds_test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
suite('client credential handling', function() {
let taskcluster = require('../');
let assert = require('assert');
let request = require('superagent');
let _ = require('lodash');
const taskcluster = require('../');
const assert = require('assert');
const request = require('superagent');
const _ = require('lodash');
const testing = require('taskcluster-lib-testing');

suite(testing.suiteName(), function() {
// This suite exercises the credential-handling functionality of the client
// against a the auth service's testAuthenticate endpoint.

Expand Down
20 changes: 10 additions & 10 deletions clients/client/test/retry_test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
suite('retry-test', function() {
const taskcluster = require('../');
const assert = require('assert');
const SchemaSet = require('taskcluster-lib-validate');
const MonitorManager = require('taskcluster-lib-monitor');
const APIBuilder = require('taskcluster-lib-api');
const testing = require('taskcluster-lib-testing');
const App = require('taskcluster-lib-app');
const http = require('http');
const httpProxy = require('http-proxy');
const taskcluster = require('../');
const assert = require('assert');
const SchemaSet = require('taskcluster-lib-validate');
const MonitorManager = require('taskcluster-lib-monitor');
const APIBuilder = require('taskcluster-lib-api');
const testing = require('taskcluster-lib-testing');
const App = require('taskcluster-lib-app');
const http = require('http');
const httpProxy = require('http-proxy');

suite(testing.suiteName(), function() {
const PROXY_PORT = 60551;
const rootUrl = `http://localhost:${PROXY_PORT}`;
let proxier;
Expand Down
9 changes: 5 additions & 4 deletions clients/client/test/utils_test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
suite('taskcluster utilities', function() {
let taskcluster = require('../');
let parseTime = require('../src/parsetime');
let assert = require('assert');
const taskcluster = require('../');
const parseTime = require('../src/parsetime');
const assert = require('assert');
const testing = require('taskcluster-lib-testing');

suite(testing.suiteName(), function() {
test('parseTime 1 year', function() {
assert.equal(parseTime('1y').years, 1);
assert.equal(parseTime('1 yr').years, 1);
Expand Down
2 changes: 1 addition & 1 deletion libraries/api/test/auth_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const testing = require('taskcluster-lib-testing');
const path = require('path');
const debug = require('debug')('auth_test');

suite('api/auth', function() {
suite(testing.suiteName(), function() {
// Reference for test api server
let _apiServer = null;

Expand Down
3 changes: 2 additions & 1 deletion libraries/api/test/context_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ const request = require('superagent');
const slugid = require('slugid');
const path = require('path');
const helper = require('./helper');
const testing = require('taskcluster-lib-testing');

suite('API (context)', function() {
suite(testing.suiteName(), function() {
const rootUrl = 'http://localhost:4321';
test('Provides context', async () => {
// Create test api
Expand Down
3 changes: 2 additions & 1 deletion libraries/api/test/errors_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ const helper = require('./helper');
const _ = require('lodash');
const libUrls = require('taskcluster-lib-urls');
const expressError = require('../src/middleware/express-error.js');
const testing = require('taskcluster-lib-testing');

suite('api/errors', function() {
suite(testing.suiteName(), function() {
// Create test api
const builder = new APIBuilder({
title: 'Test Api',
Expand Down
3 changes: 2 additions & 1 deletion libraries/api/test/expressions_test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const assert = require('assert');
const ScopeExpressionTemplate = require('../src/expressions');
const testing = require('taskcluster-lib-testing');

suite('expression expansion success', function() {
suite(testing.suiteName(), function() {

function scenario(expr, params, result, shouldFail=false) {
return () => {
Expand Down
4 changes: 2 additions & 2 deletions libraries/api/test/middleware_test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const assert = require('assert');
const APIBuilder = require('../');
const testing = require('taskcluster-lib-testing');

suite('api/middleware', function() {

suite(testing.suiteName(), function() {
test('middleware is exported', function() {
assert(APIBuilder.middleware);
});
Expand Down
3 changes: 2 additions & 1 deletion libraries/api/test/noncemanager_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ const API = require('../src/api');
const assert = require('assert');
const Promise = require('promise');
const debug = require('debug')('base:test:nonceManager');
const testing = require('taskcluster-lib-testing');

suite('nonceManager test', function() {
suite(testing.suiteName(), function() {
// Create a new nonceManager for each test
let nonceManager = null;
setup(function() {
Expand Down
3 changes: 2 additions & 1 deletion libraries/api/test/publish_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ const config = require('taskcluster-lib-config');
const aws = require('aws-sdk');
const assert = require('assert');
const libUrls = require('taskcluster-lib-urls');
const testing = require('taskcluster-lib-testing');

suite('api/publish', function() {
suite(testing.suiteName(), function() {
const cfg = config({});

if (!cfg.aws || !cfg.referenceTestBucket) {
Expand Down
3 changes: 2 additions & 1 deletion libraries/api/test/responsetimer_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ const APIBuilder = require('../');
const MonitorManager = require('taskcluster-lib-monitor');
const helper = require('./helper');
const libUrls = require('taskcluster-lib-urls');
const testing = require('taskcluster-lib-testing');

suite('api/responsetimer', function() {
suite(testing.suiteName(), function() {
// Create test api
const builder = new APIBuilder({
title: 'Test Api',
Expand Down
3 changes: 2 additions & 1 deletion libraries/api/test/route_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ const APIBuilder = require('../');
const slugid = require('slugid');
const helper = require('./helper');
const libUrls = require('taskcluster-lib-urls');
const testing = require('taskcluster-lib-testing');

suite('api/route', function() {
suite(testing.suiteName(), function() {
const u = path => libUrls.api(helper.rootUrl, 'test', 'v1', path);

// Create test api
Expand Down
3 changes: 2 additions & 1 deletion libraries/api/test/scopes_test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const assert = require('assert');
const APIBuilder = require('../');
const testing = require('taskcluster-lib-testing');

suite('api/route', function() {
suite(testing.suiteName(), function() {
// Create test api
const builder = new APIBuilder({
title: 'Test Api',
Expand Down
3 changes: 2 additions & 1 deletion libraries/api/test/validate_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ const libUrls = require('taskcluster-lib-urls');
const path = require('path');
const SchemaSet = require('taskcluster-lib-validate');
const MonitorManager = require('taskcluster-lib-monitor');
const testing = require('taskcluster-lib-testing');

suite('api/validate', function() {
suite(testing.suiteName(), function() {
const u = path => libUrls.api(helper.rootUrl, 'test', 'v1', path);

// Create test api
Expand Down
3 changes: 2 additions & 1 deletion libraries/app/test/app_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ let App = require('../');
let request = require('superagent');
let express = require('express');
let isUUID = require('is-uuid');
const testing = require('taskcluster-lib-testing');

suite('app', function() {
suite(testing.suiteName(), function() {

// Test app creation
suite('app({port: 1459})', function() {
Expand Down
Empty file removed libraries/azure/test/basic_test.js
Empty file.
3 changes: 2 additions & 1 deletion libraries/azure/test/index_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ const {sasCredentials} = require('..');
const nock = require('nock');
const url = require('url');
const libUrls = require('taskcluster-lib-urls');
const testing = require('taskcluster-lib-testing');

suite('index_test.js', function() {
suite(testing.suiteName(), function() {
let scope;

const mockAzureTableSAS = (accessLevel) => {
Expand Down
10 changes: 6 additions & 4 deletions libraries/config/test/config_test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
suite('config', function() {
let config = require('../');
let path = require('path');
let assume = require('assume');
const config = require('../');
const path = require('path');
const assume = require('assume');
const testing = require('taskcluster-lib-testing');

suite(testing.suiteName(), function() {

test('load yaml', () => {
let cfg = config({
Expand Down
3 changes: 2 additions & 1 deletion libraries/docs/test/main_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const APIBuilder = require('taskcluster-lib-api');
const {Exchanges} = require('taskcluster-lib-pulse');
const MockS3UploadStream = require('./mockS3UploadStream');
const tmp = require('tmp');
const testing = require('taskcluster-lib-testing');

function assertInTarball(shoulds, tarball) {
shoulds.push('metadata.json');
Expand Down Expand Up @@ -38,7 +39,7 @@ function assertInTarball(shoulds, tarball) {
});
}

suite('documenter', () => {
suite(testing.suiteName(), () => {
let schemaset = null;
let exchanges = null;
let references = null;
Expand Down
15 changes: 0 additions & 15 deletions libraries/docs/test/package_test.js

This file was deleted.

3 changes: 2 additions & 1 deletion libraries/iterate/test/iterate_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ let sandbox = require('sinon').createSandbox();
let assume = require('assume');
let debug = require('debug')('iterate-test');
let MonitorManager = require('taskcluster-lib-monitor');
const testing = require('taskcluster-lib-testing');

let possibleEvents = [
'started',
Expand Down Expand Up @@ -49,7 +50,7 @@ class IterateEvents {

}

suite('Iterate', () => {
suite(testing.suiteName(), () => {
let manager;
let monitor;

Expand Down
3 changes: 2 additions & 1 deletion libraries/iterate/test/watchdog_test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
let subject = require('../src/watchdog');
let sinon = require('sinon');
let assume = require('assume');
const testing = require('taskcluster-lib-testing');

suite('watchdog', function() {
suite(testing.suiteName(), function() {
let events, start;

setup(function() {
Expand Down
2 changes: 1 addition & 1 deletion libraries/monitor/test/base_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const testing = require('taskcluster-lib-testing');
const stream = require('stream');
const MonitorManager = require('../src');

suite('BaseMonitor', function() {
suite(testing.suiteName(), function() {
let manager, monitor, messages;

setup(function() {
Expand Down
3 changes: 2 additions & 1 deletion libraries/monitor/test/logger_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ const assert = require('assert');
const stream = require('stream');
const Ajv = require('ajv');
const MonitorManager = require('../src');
const testing = require('taskcluster-lib-testing');

suite('Logging', function() {
suite(testing.suiteName(), function() {
let manager, monitor, messages, destination;

setup(function() {
Expand Down
3 changes: 2 additions & 1 deletion libraries/monitor/test/registry_test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const assert = require('assert');
const MonitorManager = require('../src');
const testing = require('taskcluster-lib-testing');

suite('Registry', function() {
suite(testing.suiteName(), function() {

test('can add custom message types', function() {
const manager = new MonitorManager({
Expand Down
3 changes: 2 additions & 1 deletion libraries/pulse/test/client_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const assume = require('assume');
const debugModule = require('debug');
const libMonitor = require('taskcluster-lib-monitor');
const slugid = require('slugid');
const testing = require('taskcluster-lib-testing');

const PULSE_CONNECTION_STRING = process.env.PULSE_CONNECTION_STRING;

Expand Down Expand Up @@ -298,7 +299,7 @@ const connectionTests = connectionString => {
});
};

suite('Client', function() {
suite(testing.suiteName(), function() {
suite('with RabbitMQ', function() {
suiteSetup(function() {
if (!PULSE_CONNECTION_STRING) {
Expand Down
3 changes: 2 additions & 1 deletion libraries/pulse/test/consumer_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ const assume = require('assume');
const debugModule = require('debug');
const libMonitor = require('taskcluster-lib-monitor');
const assert = require('assert');
const testing = require('taskcluster-lib-testing');

const PULSE_CONNECTION_STRING = process.env.PULSE_CONNECTION_STRING;

suite('consumer_test.js', function() {
suite(testing.suiteName(), function() {
suite('PulseConsumer', function() {
// use a unique name for each test run, just to ensure nothing interferes
const unique = new Date().getTime().toString();
Expand Down
3 changes: 2 additions & 1 deletion libraries/pulse/test/credentials_test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const {pulseCredentials} = require('../src');
const assert = require('assert');
const assume = require('assume');
const testing = require('taskcluster-lib-testing');

suite('pulseCredentials', function() {
suite(testing.suiteName(), function() {
test('missing arguments are an error', async function() {
assume(() => pulseCredentials({password: 'pw', hostname: 'h', vhost: 'v'}))
.throws(/username/);
Expand Down
Loading

0 comments on commit c7f0640

Please sign in to comment.