Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-cox committed Jan 9, 2020
2 parents 05ce2a8 + ea3778a commit f2fb41a
Show file tree
Hide file tree
Showing 483 changed files with 9,178 additions and 11,566 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ deploy/stratos-ui-release/dev_releases/
output/fissile
deploy/ci/travis/temp/

# Helm Chart Image List
deploy/kubernetes/console/imagelist.txt

.dist/
deploy/uaa/tmp/
src/backend/*/vendor/
Expand Down
11 changes: 8 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "10.16.3"
- "12.13.0"
sudo: required
dist: bionic
services:
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
before_script:
- curl -sL -o ~/bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
- chmod +x ~/bin/gimme
- eval "$(gimme 1.12.4)"
- eval "$(gimme 1.13.4)"
- go get -u golang.org/x/lint/golint
script:
- golint src/jetstream/...
Expand All @@ -61,7 +61,7 @@ jobs:
before_script:
- curl -sL -o ~/bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
- chmod +x ~/bin/gimme
- eval "$(gimme 1.12.4)"
- eval "$(gimme 1.13.4)"
script:
- npm run test-backend
- name: Helm Chart Unit Tests
Expand All @@ -82,6 +82,11 @@ jobs:
- "./deploy/ci/travis/job-e2e-before_script.sh true"
script:
- "./deploy/ci/travis/job-e2e-script.sh core"
- name: E2E Tests - Autoscaler
before_script:
- "./deploy/ci/travis/job-e2e-before_script.sh"
script:
- "./deploy/ci/travis/job-e2e-script.sh autoscaler"
- name: E2E Tests - All Other Suite
before_script:
- "./deploy/ci/travis/job-e2e-before_script.sh"
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Change Log

## 2.6.1

[Full Changelog](https://github.com/cloudfoundry/stratos/compare/2.6.0...2.6.1)

This release contains a few fixes:

**Fixes:**

- Helm Chart does not work with Kubernetes 1.16 [\#4022](https://github.com/cloudfoundry/stratos/issues/4022)
- Generated Ingress certificates during Kubernetes deployment are empty [\#4006](https://github.com/cloudfoundry/stratos/issues/4006)
- Kubernetes Ingress certificate is incorrectly set [\#4005](https://github.com/cloudfoundry/stratos/issues/4005)
- Update metric used for cells [\#4009](https://github.com/cloudfoundry/stratos/pull/4009)
- Fix incorrect SSO behaviour following 2.4.0 --> 2.6.0 upgrade [\#4015](https://github.com/cloudfoundry/stratos/pull/4015)

## 2.6.0

[Full Changelog](https://github.com/SUSE/stratos/compare/2.5.3...2.6.0)
Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,8 @@ Stratos can be deployed in the following environments:
3. Docker, single container deploying all components. See [guide](deploy/all-in-one)

## Troubleshooting
Please see our [Troubleshooting](docs/troubleshooting) page.

## Project Planning
We use [ZenHub](https://zenhub.com) for project planning. Feel free to head over to the [Boards](https://github.com/SUSE/stratos#boards)
tab and have a look through our pipelines and milestones. Please note in order to view the Github ZenHub Boards tab you will need the [ZenHub
browser extension](https://www.zenhub.com/extension). Alternatively, to view the planning board without the extension visit our [ZenHub Project Page](https://app.zenhub.com/workspace/o/cloudfoundry/stratos/boards)
Please see our [Troubleshooting](docs/troubleshooting) page.

## Further Reading

Expand Down Expand Up @@ -75,3 +71,4 @@ Tested with Browserstack
## License

The work done has been licensed under Apache License 2.0. The license file can be found [here](LICENSE).

8,341 changes: 0 additions & 8,341 deletions action-builders-branch-tests

This file was deleted.

38 changes: 0 additions & 38 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,44 +242,6 @@
}
}
},
"store-helpers": {
"root": "src/frontend/packages/store-helpers",
"sourceRoot": "src/frontend/packages/store-helpers/src",
"projectType": "library",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "src/frontend/packages/store-helpers/tsconfig.lib.json",
"project": "src/frontend/packages/store-helpers/ng-package.json"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/frontend/packages/store-helpers/src/test.ts",
"tsConfig": "src/frontend/packages/store-helpers/tsconfig.spec.json",
"karmaConfig": "src/frontend/packages/store-helpers/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.json"
],
"tslintConfig": "src/frontend/packages/store-helpers/tslint.json",
"files": [
"src/frontend/packages/store-helpers/src/**/*.ts"
],
"exclude": [
"!src/frontend/packages/store-helpers/**"
]
}
}
}
},
"cloud-foundry": {
"root": "src/frontend/packages/cloud-foundry",
"sourceRoot": "src/frontend/packages/cloud-foundry/src",
Expand Down
2 changes: 1 addition & 1 deletion browserslist
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.
IE 9-11
2 changes: 1 addition & 1 deletion build/bk-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if [ "${ACTION}" == "build" ]; then
echo "Build complete ..."
else
echo "Running backend tests ..."
GO111MODULE=on go test ./... -v
GO111MODULE=on go test ./... -v -count=1
fi

popd > /dev/null
Expand Down
11 changes: 11 additions & 0 deletions build/clean-test-reports.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

STRATOS_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd .. && pwd)"

rm -f "${STRATOS_PATH}/coverage/stratos-unittest-*.txt"
rm -f "${STRATOS_PATH}/coverage/stratos-unittests.json"
rm -f "${STRATOS_PATH}/coverage/stratos-unittests.txt"
rm -f "${STRATOS_PATH}/coverage/stratos-exitcode.txt"

# Create the coverage folder if needed
mkdir -p "${STRATOS_PATH}/coverage"
20 changes: 20 additions & 0 deletions build/customize-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
const CUSTOM_METADATA = path.resolve(__dirname, '../custom-src/stratos.yaml');
const GIT_FOLDER = path.resolve(__dirname, '../.git');
const GIT_METADATA = path.resolve(__dirname, '../.stratos-git-metadata.json');
const INDEX_LOADING_HTML_CUSTOM = path.resolve(__dirname, '../custom-src/frontend/loading.html');
const INDEX_LOADING_HTML_DEFAULT = path.resolve(__dirname, '../src/frontend/packages/core/misc/custom/loading.html');
const INDEX_LOADING_CSS_CUSTOM = path.resolve(__dirname, '../custom-src/frontend/loading.css');
const INDEX_LOADING_CSS_DEFAULT = path.resolve(__dirname, '../src/frontend/packages/core/misc/custom/loading.css');

// Apply any customizations
// Symlink customizations of the default resources for Stratos
Expand Down Expand Up @@ -264,6 +268,22 @@

// Date and Time that the build was made (approximately => it is when this script is run)
replace.sync({ files: INDEX_HTML, from: '@@stratos_build_date@@', to: new Date() });

// Replace loading indicator - HTML
let loadingHtmlFile = INDEX_LOADING_HTML_DEFAULT;
if (fs.existsSync(INDEX_LOADING_HTML_CUSTOM)) {
loadingHtmlFile = INDEX_LOADING_HTML_CUSTOM
}
const loadingHtml = fs.readFileSync(loadingHtmlFile, 'utf8');
replace.sync({ files: INDEX_HTML, from: '<!-- @@LOADING_HTML@@ -->', to: loadingHtml });

// Replace loading indicator - CSS
let loadingCssFile = INDEX_LOADING_CSS_DEFAULT;
if (fs.existsSync(INDEX_LOADING_CSS_CUSTOM)) {
loadingCssFile = INDEX_LOADING_CSS_CUSTOM
}
const loadingCss = fs.readFileSync(loadingCssFile, 'utf8');
replace.sync({ files: INDEX_HTML, from: '/** @@LOADING_CSS@@ **/', to: loadingCss });
}

// We can only do this if we have a git repository checkout
Expand Down
9 changes: 9 additions & 0 deletions build/karma.conf.creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ module.exports = function (project) {
var path = require('path')
var repoRoot = path.join(__dirname, '..')
return function (config) {

var testReportFile = process.env.NG_TEST_SUITE || 'report';
testReportFile = `stratos-unittest-${testReportFile}.txt`;
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
Expand Down Expand Up @@ -30,6 +33,12 @@ module.exports = function (project) {
specReporter: {
suppressSkipped: true, // skip result of skipped tests
},
stratosReporter: {
reportFile: path.join(repoRoot, 'coverage', testReportFile),
jsonFile: path.join(repoRoot, 'coverage', 'stratos-unittests.json'),
summaryFile: path.join(repoRoot, 'coverage', 'stratos-unittests.txt'),
exitCodeFile: path.join(repoRoot, 'coverage', 'stratos-exitcode.txt')
},
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
Expand Down
133 changes: 128 additions & 5 deletions build/karma.test.reporter.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,159 @@

(function () {
'use strict';

var fs = require('fs');

/**
* Custom spec reporter that will fail the tests if any are skipped
*
* It only does this if the CI_ENV environment variable is set to 'true'
*
*/
var StratosSpecReporter = function (baseReporterDecorator) {
var StratosSpecReporter = function (baseReporterDecorator, config) {
baseReporterDecorator(this);

const reporterConfig = Object.assign({}, config.stratosReporter);
this.file = reporterConfig.reportFile || './stratos-test-report.log';
this.jsonFile = reporterConfig.jsonFile || './stratos-test-report.json';
this.summaryFile = reporterConfig.summaryFile || './stratos-test-report.txt';
this.exitCodeFile = reporterConfig.exitCodeFile || './stratos-test.exitcode';

this.skipped = 0;
this.total = 0;
this.failed = [];

this.bold = '\x1b[1m';
this.red = '\x1b[31m';
this.cyan = '\x1b[96m';
this.yellow = '\x1b[33m';
this.reset = '\x1b[0m';
this.bluebg = '\x1b[44m';
this.grey = '\x1b[90m';

// Running totals accumated across other test runs
this.runningTotals = {};

this.exitCode = 0;

if (fs.existsSync(this.jsonFile)) {
let rawdata = fs.readFileSync(this.jsonFile);
this.runningTotals = JSON.parse(rawdata);
} else {
this.runningTotals = {
total: 0,
passed: 0,
skipped: 0,
failed: 0,
};
}

if (fs.existsSync(this.exitCodeFile)) {
let rawdata = fs.readFileSync(this.exitCodeFile);
this.exitCode = parseInt(rawdata);
}

this.onSpecComplete = function (browser, result) {
this.writeFile = (msg) => {
fs.appendFileSync(this.file, `${msg}\n`);
}

this.writeSummaryFile = (msg) => {
fs.appendFileSync(this.summaryFile, `${msg}\n`);
}

this.onSpecComplete = (browser, result) => {
this.total = this.total + 1;
this.skipped += result.skipped ? 1 : 0;
if (!result.success) {
this.failed.push(result);
}
};

this.onRunComplete = function (browser, result) {
this.generateSummary = () => {

if (fs.existsSync(this.summaryFile)) {
fs.unlinkSync(this.summaryFile);
}

const all = this.runningTotals;

this.writeSummaryFile(`${this.bold}${this.cyan}================================================================================${this.reset}`);
this.writeSummaryFile(`${this.bold}${this.cyan}Test Summary${this.reset}`);
this.writeSummaryFile(`${this.bold}${this.cyan}================================================================================${this.reset}`);
this.writeSummaryFile(`Total : ${this.bold}${this.cyan}${all.total}${this.reset}`)
this.writeSummaryFile(`Passed : ${this.bold}${this.cyan}${all.passed}${this.reset}`)
this.writeSummaryFile(`Failed : ${this.bold}${this.red}${all.failed}${this.reset}`)
this.writeSummaryFile(`Skipped : ${this.bold}${this.yellow}${all.skipped}${this.reset}`)
}

this.onRunComplete = (browser, result) => {

if (fs.existsSync(this.file)) {
fs.unlinkSync(this.file);
}

let passed = this.total - this.failed.length - this.skipped;
if (process.env['CHECK_TESTS'] === 'true' && this.skipped !== 0) {
// result.exitCode = 1;
console.log('\x1b[41m\x1b[97m\x1b[1m');
console.log('');
console.log(' WRANING: ' + this.skipped + ' tests were skipped');
console.log(' WARNING: ' + this.skipped + ' tests were skipped');
console.log('');
console.log(' Check that you have not used fdescribe, fit, xdescribe or xit by mistake');
console.log('');
console.log('\x1b[0m');
}

try {

this.writeFile(`${this.bold}${this.cyan}Test results for package ${this.bluebg} ${process.env.NG_TEST_SUITE} ${this.reset}`);
this.writeFile(`Total : ${this.bold}${this.cyan}${this.total}${this.reset}`)
this.writeFile(`Passed : ${this.bold}${this.cyan}${passed}${this.reset}`)
this.writeFile(`Failed : ${this.bold}${this.red}${this.failed.length}${this.reset}`)
this.writeFile(`Skipped : ${this.bold}${this.yellow}${this.skipped}${this.reset}`)

if (this.failed.length === 0) {
fs.appendFileSync(this.file, 'All tests passed\n')
} else {
this.writeFile('Test failures:');
this.failed.forEach(f => {
this.writeFile(`${this.red}${this.bold} - ${f.fullName}${this.reset}`);
const logs = f.log || [];
logs.forEach(l => fs.appendFileSync(this.file, `${this.grey} ${l}${this.reset}`));
// Add empty line
this.writeFile('');
});
}

// Update running totals JSON
this.runningTotals.total += this.total;
this.runningTotals.passed += passed;
this.runningTotals.failed += this.failed.length;
this.runningTotals.skipped += this.skipped;
fs.writeFileSync(this.jsonFile, JSON.stringify(this.runningTotals));

this.generateSummary();

// Write exit code
let newExitCode = this.exitCode;
if (result.exitCode > 0) {
newExitCode = result.exitCode
}

fs.writeFileSync(this.exitCodeFile, newExitCode.toString());

// Dump the summary for this test suite
var contents = fs.readFileSync(this.file, 'utf8');
console.log(contents);

} catch(e) {
console.log('ERROR while reporting test result');
console.log(e);
}
};
};

StratosSpecReporter.$inject = ['baseReporterDecorator'];
StratosSpecReporter.$inject = ['baseReporterDecorator', 'config'];

module.exports = {
'reporter:stratos': ['type', StratosSpecReporter]
Expand Down
Loading

0 comments on commit f2fb41a

Please sign in to comment.