Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve tests by @mikejpeters #144

Merged
merged 4 commits into from
Feb 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
name: Main Workflow
name: Run integration tests

on:
push:
branches:
- 'master'

- master

jobs:
build:
runs-on: ubuntu-latest
env:
SERVERLESS_VERSION: '3.3.0'
steps:
- uses: aws-actions/configure-aws-credentials@v1
with:
Expand All @@ -18,9 +20,5 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: 16
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- run: pip install -r test/requirements.txt
- run: npm ci
- run: npm test
- run: npm run integration-test
42 changes: 0 additions & 42 deletions .github/workflows/npm-publish.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This workflow will publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Publish package to npmjs

on:
release:
types: [created]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Run unit tests

on:
push:
mikejpeters marked this conversation as resolved.
Show resolved Hide resolved
branches:
- master
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
env:
SERVERLESS_VERSION: '3.3.0'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- run: npm ci
- run: npm test
12 changes: 4 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const path = require('path');
const fs = require('fs');

const Confirm = require('enquirer');
const confirm = require('@serverless/utils/inquirer/confirm');

const bucketUtils = require('./lib/bucketUtils');
const configure = require('./lib/configure');
Expand Down Expand Up @@ -100,7 +100,7 @@ class Client {
manageResources = this.options.manageResources;
return this.cliOptions.confirm === false
? true
: new Confirm(`Are you sure you want to delete bucket '${bucketName}'?`).run();
: confirm(`Are you sure you want to delete bucket '${bucketName}'?`);
})
.then(goOn => {
if (goOn) {
Expand Down Expand Up @@ -220,9 +220,7 @@ class Client {
}

deployDescribe.forEach(m => this.serverless.cli.log(m));
return this.cliOptions.confirm === false
? true
: new Confirm(`Do you want to proceed?`).run();
return this.cliOptions.confirm === false ? true : confirm(`Do you want to proceed?`);
})
.then(goOn => {
if (goOn) {
Expand Down Expand Up @@ -305,9 +303,7 @@ class Client {
})
.then(() => {
this.serverless.cli.log(
`Success! Your site should be available at http://${bucketName}.${
regionUrls[region]
}/`
`Success! Your site should be available at http://${bucketName}.${regionUrls[region]}/`
);
});
}
Expand Down
Loading