-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure and add Sourcegraph instance smoke tests
- Loading branch information
Showing
28 changed files
with
7,340 additions
and
981 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module.exports = { | ||
extends: ['@sourcegraph/eslint-config'], | ||
env: { | ||
node: true, | ||
es6: true, | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
sourceType: 'module', | ||
EXPERIMENTAL_useSourceOfProjectReferenceRedirect: true, | ||
project: ['./packages/**/tsconfig.json'], | ||
tsconfigRootDir: __dirname, | ||
warnOnUnsupportedTypeScriptVersion: false, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: build | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
FORCE_COLOR: 3 | ||
|
||
defaults: | ||
run: | ||
working-directory: packages/web-functionality | ||
|
||
jobs: | ||
build-web-functionality: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# set up correct version of node | ||
- id: nvmrc | ||
run: echo ::set-output name=NODE_VERSION::$(cat ../../.nvmrc) | ||
- uses: actions/setup-node@v2 | ||
with: { node-version: '${{ steps.nvmrc.outputs.NODE_VERSION }}' } | ||
|
||
- run: yarn | ||
|
||
# checks | ||
- run: yarn run prettier-check | ||
- run: yarn run eslint | ||
|
||
# build | ||
- run: yarn run build | ||
|
||
# publish | ||
- name: release | ||
if: github.event_name == 'push' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: yarn run semantic-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,104 +1,23 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
# Vim | ||
*.swp | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
# JetBrains/IntelliJ | ||
.idea | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
# Emacs | ||
*~ | ||
\#*\# | ||
/.emacs.desktop | ||
/.emacs.desktop.lock | ||
.\#* | ||
.dir-locals.el | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
# Mac OS X | ||
.DS_Store | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Microbundle cache | ||
.rpt2_cache/ | ||
.rts2_cache_cjs/ | ||
.rts2_cache_es/ | ||
.rts2_cache_umd/ | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.env.test | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
|
||
# Next.js build output | ||
.next | ||
|
||
# Nuxt.js build / generate output | ||
.nuxt | ||
dist | ||
|
||
# Gatsby files | ||
.cache/ | ||
# Comment in the public line in if your project uses Gatsby and *not* Next.js | ||
# https://nextjs.org/blog/next-9-1#public-directory-support | ||
# public | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# TernJS port file | ||
.tern-port | ||
node_modules | ||
npm-debug.log | ||
yarn-error.log | ||
.eslintcache | ||
*.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
**/fixtures/**/* | ||
**/dist | ||
**/coverage | ||
**/.vscode | ||
**/.vs | ||
**/packages/web-performance/reports | ||
**/packages/web-performance/.lighthouseci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"typescript.format.semicolons": "remove", | ||
"eslint.validate": ["javascript", "typescript"], | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true, | ||
}, | ||
"eslint.packageManager": "yarn", | ||
"eslint.codeActionsOnSave.mode": "problems", | ||
"eslint.options": { "cache": true }, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
## Smoke tests at Sourcegraph | ||
## Sourcegraph Smoke tests | ||
|
||
TODO | ||
This repository contains a series of smoke tests that can be ran against Sourcegraph instances. | ||
|
||
### Web functionality | ||
|
||
Series of checks that assess if a Sourcegraph instance is functioning properly. | ||
|
||
See the [README](./packages/web-functionality/README.md) for more information. | ||
|
||
### Web performance | ||
|
||
Series of Lighthouse audits that measure web performance on Sourcegraph.com | ||
|
||
See the [README](./packages/web-performance/README.md) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,34 @@ | ||
{ | ||
"name": "smoke-tests", | ||
"name": "@sourcegraph/smoke-tests", | ||
"version": "1.0.0", | ||
"description": "Smoke tests against Sourcegraph applications", | ||
"private": true, | ||
"workspaces": ["packages/*"], | ||
"dependencies": {}, | ||
"devDependencies": {}, | ||
"workspaces": [ | ||
"packages/*" | ||
], | ||
"dependencies": { | ||
"@commitlint/cli": "^14.1.0", | ||
"@commitlint/config-conventional": "^14.1.0", | ||
"@sourcegraph/eslint-config": "^0.27.0", | ||
"@sourcegraph/prettierrc": "^3.0.3", | ||
"eslint": "^7.32.0", | ||
"husky": "^4.3.5", | ||
"prettier": "^2.6.0", | ||
"semantic-release": "^17.1.2" | ||
}, | ||
"commitlint": { | ||
"extends": [ | ||
"@commitlint/config-conventional" | ||
] | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"commit-msg": "commitlint -e $HUSKY_GIT_PARAMS" | ||
} | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/sourcegraph/smoke-tests.git" | ||
}, | ||
"author": "", | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/sourcegraph/smoke-tests/issues" | ||
}, | ||
"homepage": "https://github.com/sourcegraph/smoke-tests#readme" | ||
"license": "Apache-2.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
lib | ||
jest.config.js | ||
jest-puppeteer.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,22 @@ | ||
# smoke-tests [DRAFT] | ||
## Smoke tests: Web functionality | ||
|
||
A proposal for basic smoke tests, which could be plugged in [Cloud deploy pipeline](https://buildkite.com/sourcegraph/deploy-sourcegraph-cloud) to ensure basic happy paths are working (or used on schedule). | ||
These smoke tests run some basic checks against a deployed Sourcegraph instance. | ||
|
||
[CodeceptJS](https://codecept.io/) with [Puppeter helper](https://codecept.io/helpers/Puppeteer/) was used, just b/c it is quite easy to replace helper to support more browsers at any point. | ||
### How to run | ||
|
||
`SOURCEGRAPH_URL="https://sourcegraph.com" npx @sourcegraph/web-smoke-tests@latest start` | ||
|
||
### Environment reference | ||
|
||
| Variable | Meaning | | ||
| ------------------------ | :--------------------------------------------------------------------------------------------------: | | ||
| `SOURCEGRAPH_URL` | The URL of the deployed instance to run checks against | | ||
| `JEST_JUNIT_OUTPUT_NAME` | The name of a generated JUnit report summary for failure analysis. Default is "junit.xml". | | ||
| `JEST_JUNIT_OUTPUT_DIR` | The directory in which the generated JUnit report should be stored. Default is the current directory | | ||
|
||
## Releases | ||
|
||
Releases are done automatically in CI when commits are merged into master by analyzing [Conventional Commit Messages](https://conventionalcommits.org/). | ||
After running `yarn`, commit messages will be linted automatically when committing though a git hook. | ||
The git hook can be circumvented for fixup commits with [git's `fixup!` autosquash feature](https://fle.github.io/git-tip-keep-your-branch-clean-with-fixup-and-autosquash.html), or by passing `--no-verify` to `git commit`. | ||
You may have to rebase a branch before merging to ensure it has a proper commit history, or squash merge with a manually edited commit message that conforms to the convention. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = { | ||
launch: { | ||
headless: process.env.HEADLESS !== 'false', | ||
product: 'chrome', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
preset: 'jest-puppeteer', | ||
haste: { | ||
providesModuleNodeModules: ['.*'], | ||
}, | ||
testMatch: ['<rootDir>/lib/**/*.test.js'], | ||
testPathIgnorePatterns: ['<rootDir>/node_modules/'], | ||
transformIgnorePatterns: ['<rootDir>/node_modules/'], | ||
modulePathIgnorePatterns: ['<rootDir>/node_modules/'], | ||
testResultsProcessor: 'jest-junit', | ||
} |
Oops, something went wrong.