Skip to content

Commit

Permalink
Cleanup before publish (#5)
Browse files Browse the repository at this point in the history
* move to top level

* merged README tweak

* add additional outputs and cleanup workflows

* add updated js files

* add prettier config

* update README with new outputs

* re-apply prettier;  PR feedback on README
  • Loading branch information
gcooney committed Aug 6, 2019
1 parent 96ece69 commit 2ce5de1
Show file tree
Hide file tree
Showing 791 changed files with 180 additions and 114 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/deployment-workflow.yaml
Expand Up @@ -7,8 +7,10 @@ jobs:
name: Mabl Test
runs-on: ubuntu-latest
steps:
- name: Create mabl deployment event
uses: ./deploy-and-test/
- uses: actions/checkout@master
- name: Run mabl tests against deployment
id: mabl-test-deployment
uses: ./
env:
MABL_API_KEY: ${{ secrets.MABL_API_KEY }}
with:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/push-workflow.yaml
Expand Up @@ -8,10 +8,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Functional test deployment
- name: Run mabl tests against deployment
id: mabl-test-deployment
uses: ./deploy-and-test/
uses: ./
env:
MABL_API_KEY: ${{ secrets.MABL_API_KEY }}
with:
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
@@ -0,0 +1,3 @@
package.json
node_modules
dist
10 changes: 10 additions & 0 deletions .prettierrc
@@ -0,0 +1,10 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": false,
"jsxBracketSameLine": false,
"proseWrap": "always"
}
File renamed without changes.
102 changes: 97 additions & 5 deletions README.md
@@ -1,13 +1,105 @@
![mabl logo](https://avatars3.githubusercontent.com/u/25963599?s=100&v=4)
## mabl GitHub Actions

This repo contains [mabl](https://mabl.com)'s GitHub Actions. Presently there is a single Action, with more to follow 😊.
# mabl Functional Test Deployment Action

- [Deploy and Test Action](deploy-and-test/README.md)
This GitHub Action creates a mabl deployment event, triggering any functional
tests associated with that deployment and waiting for their results.

These Actions can be used to combine your mabl functional tests and GitHub code review/push/deploy lifecycle. Read more on [creating GitHub Workflows with Actions](https://help.github.com/en/articles/creating-a-workflow-with-github-actions).
### Example action:

```
on: [push]
name: mabl
jobs:
test:
name: mabl Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Functional test deployment
id: mabl-test-deployment
uses: ./deploy-and-test/
env:
MABL_API_KEY: ${{ secrets.MABL_API_KEY }}
application-id: <your-application-id-a>
environment-id: <your-environment-id-e>
```

### Environment variables

- `MABL_API_KEY` {string} - Your mabl API key
[available here](https://app.mabl.com/workspaces/-/settings/apis)

### Inputs

**Note**: Either `application-id` or `environment-id` must be supplied.

- `application-id` {string} (optional) - mabl id for the deployed application.
Use the
[curl builder](https://app.mabl.com/workspaces/-/settings/apis#api-docs-selector-dropdown-button)
to find the id.
- `environment-id` {string} (optional) - mabl id for the deployed environment.
Use the
[curl builder](https://app.mabl.com/workspaces/-/settings/apis#api-docs-selector-dropdown-button)
to find the id.
- `browser-types` (optional): override for browser types to test e.g.
`chrome, firefox, safari, internet_explorer`. If not provided, mabl will test
the browsers configured on the triggered test.
- `rebaseline-images` {boolean} (optional) - Set `true` to reset the visual
baseline to the current deployment
- `set-static-baseline` (optional) - Set `true` to use current deployment as an
exact static baseline. If set, mabl will **not** model dynamic areas and will
use the current deployment as the pixel-exact visual baseline.
- `continue-on-failure` (optional) - Set to true to continue the build even if
there are test failures
- `event-time` {int64} (optional) - Event time the deployment occurred in UTC
epoch milliseconds. Defaults to now.

### outputs:

- `mabl-deployment-id` {string} - mabl id of the deployment
- `plans_run` {int32} - number of mabl plans run against this deployment. A mabl
plan is a collection of similarly configured tests.
- `plans_passed` {int32} - number of mabl plans that passed against this
deployment. A mabl plan is a collection of similarly configured tests.
- `plans_failed` {int32} - number of mabl plans that failed against this
deployment. A mabl plan is a collection of similarly configured tests.
- `journeys_run` {int32} - total number of mabl journeys run against this
deployment. A mabl journey is an end to end test of your application.
- `journeys_passed` {int32} - number of mabl journeys that passed against this
deployment. A mabl journey is an end to end test of your application.
- `journeys_failed` {int32} - number of mabl journeys that failed against this
deployment. A mabl journey is an end to end test of your application.

## Contributions and Issues

If you would like to contribute, please submit a PR. If you encounter an problem, please file an Issue in this repo.
If you would like to contribute, please submit a PR. If you encounter an
problem, please file an Issue in this repo.

### Making updates

Actions need the compiled code checked in. This means your changes will only
take effect if you have run the build to generate .js files from the .ts
Typescript files and checked the .js files in as well.

### Adding new dependencies

Check in the Action with everything it needs to run. If you update dependencies
you will need to commit the changes to Node modules as well.

```bash
# Remove any non-production dependencies
npm prune --production

# Compile Typescript to ES6
npm run build

# Add the compiled Typescript output
git add lib/

# Add Node dependencies
git add -f node_modules/*
```
29 changes: 21 additions & 8 deletions deploy-and-test/action.yml → action.yml
@@ -1,8 +1,8 @@
name: 'Run mabl tests'
description: 'Register a deployment event with mabl and run associated tests'
name: "Run mabl tests"
description: "Register a deployment event with mabl and run associated tests"
branding:
icon: 'icons/mabl_logo_196px.svg'
color: '#6a67ce'
icon: "icons/mabl_logo_196px.svg"
color: "#6a67ce"
inputs:
application-id:
description: ^
Expand Down Expand Up @@ -39,11 +39,24 @@ inputs:
required: false
default: false
event-time:
description: 'The event time the deployment happened at. Defaults to now.'
description: "The event time the deployment happened at. Defaults to now."
required: false
outputs:
mabl-deployment-id:
description: 'mabl deployment event id'
description: "mabl deployment event id"
plans_run:
description: "total number of mabl plans run against this deployment. A mabl plan is a collection of similarly configured tests."
plans_passed:
description: "number of mabl plans that passed against this deployment. A mabl plan is a collection of similarly configured tests."
plans_failed:
description: "number of mabl plans that failed against this deployment. A mabl plan is a collection of similarly configured tests."
journeys_run:
description: "total number of mabl journeys run against this deployment. A mabl journey is an end to end test of your application."
journeys_passed:
description: "number of mabl journeys that passed against this deployment. A mabl journey is an end to end test of your application."
journeys_failed:
description: "number of mabl journeys that failed against this deployment. A mabl journey is an end to end test of your application."

runs:
using: 'node12'
main: 'lib/index.js'
using: "node12"
main: "lib/index.js"
82 changes: 0 additions & 82 deletions deploy-and-test/README.md

This file was deleted.

File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 7 additions & 1 deletion deploy-and-test/lib/index.js → lib/index.js
Expand Up @@ -13,7 +13,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
}
Object.defineProperty(exports, "__esModule", { value: true });
const mablApiClient_1 = require("./mablApiClient");
const table_1 = require("./table");
Expand Down Expand Up @@ -96,6 +96,12 @@ function run() {
finalExecutionResult.executions.forEach((execution) => {
table_1.prettyPrintExecution(execution);
});
core.setOutput('plans_run', '' + finalExecutionResult.plan_execution_metrics.total);
core.setOutput('plans_passed', '' + finalExecutionResult.plan_execution_metrics.passed);
core.setOutput('plans_failed', '' + finalExecutionResult.plan_execution_metrics.failed);
core.setOutput('journeys_run', '' + finalExecutionResult.plan_execution_metrics.total);
core.setOutput('journeys_passed', '' + finalExecutionResult.plan_execution_metrics.passed);
core.setOutput('journeys_failed', '' + finalExecutionResult.plan_execution_metrics.failed);
if (finalExecutionResult.plan_execution_metrics.failed === 0) {
core.debug('Deployment plans passed');
}
Expand Down
4 changes: 2 additions & 2 deletions deploy-and-test/lib/mablApiClient.js → lib/mablApiClient.js
Expand Up @@ -13,10 +13,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
}
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
}
Object.defineProperty(exports, "__esModule", { value: true });
const httpm = __importStar(require("typed-rest-client/HttpClient"));
const hm = __importStar(require("typed-rest-client/Handlers"));
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions deploy-and-test/lib/table.js → lib/table.js
@@ -1,14 +1,14 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
}
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
}
Object.defineProperty(exports, "__esModule", { value: true });
const cli_table3_1 = __importDefault(require("cli-table3"));
const moment = __importStar(require("moment"));
Expand Down
File renamed without changes.
Expand Up @@ -5,7 +5,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
}
Object.defineProperty(exports, "__esModule", { value: true });
const assert = __importStar(require("assert"));
const mablApiClient_1 = require("../mablApiClient");
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 2ce5de1

Please sign in to comment.