Skip to content

Commit

Permalink
Doc and test (#18)
Browse files Browse the repository at this point in the history
* changed testing env variables to avoid conflicts with standard env
updated documentation
formatting

* v2.0.3

* pipelines

* v2.0.4

* force public access

* v2.0.5
  • Loading branch information
awaragi authored Apr 10, 2022
1 parent 3fb1339 commit 57d1aa4
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 32 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/publish.yml → .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Package and publish
name: Continuous Deploiment Package and Publish
on:
release:
types: [published]
Expand All @@ -18,12 +18,12 @@ jobs:
- run: yarn build
- run: yarn test
env:
DOMAIN: ${{ secrets.DOMAIN }}
USERNAME: ${{ secrets.USERNAME }}
PASSWORD: ${{ secrets.PASSWORD }}
PROJECTID: 1
SUITEID: 1
ASSIGNEDTOID: 1
- run: yarn publish
TESTRAIL_DOMAIN: ${{ secrets.DOMAIN }}
TESTRAIL_USERNAME: ${{ secrets.USERNAME }}
TESTRAIL_PASSWORD: ${{ secrets.PASSWORD }}
TESTRAIL_PROJECTID: 1
TESTRAIL_SUITEID: 1
TESTRAIL_ASSIGNEDTOID: 1
- run: yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
22 changes: 11 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Test
name: Continuous Integration Checking
on:
pull_request:
types: [opened, ready_for_review, review_requested, synchronize]
push:
branches: ['master', 'develop']
branches: ["master", "develop"]
jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -12,17 +12,17 @@ jobs:
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
node-version: "14.x"
registry-url: "https://registry.npmjs.org"
# Defaults to the user or organization that owns the workflow file
scope: '@octocat'
scope: "@octocat"
- run: yarn
- run: yarn build
- run: yarn test
env:
DOMAIN: ${{ secrets.DOMAIN }}
USERNAME: ${{ secrets.USERNAME }}
PASSWORD: ${{ secrets.PASSWORD }}
PROJECTID: 1
SUITEID: 1
ASSIGNEDTOID: 1
TESTRAIL_DOMAIN: ${{ secrets.DOMAIN }}
TESTRAIL_USERNAME: ${{ secrets.USERNAME }}
TESTRAIL_PASSWORD: ${{ secrets.PASSWORD }}
TESTRAIL_PROJECTID: 1
TESTRAIL_SUITEID: 1
TESTRAIL_ASSIGNEDTOID: 1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ node-debug*
.c9/
*.iml
.idea/
*.sh
dist
.env
*.tgz
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dist/
node_modules/*
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ Only passed or failed tests will be published. Skipped or pending tests will not
- Add a new test suite (ids: 1)
- Add at least 4 test cases (ids: C1, C2, C3, C4, etc)
- Once setup, set your environment variables - recommend using .env file in the root folder
- DOMAIN=XXX.testrail.io
- USERNAME=XXX
- PASSWORD=XXX
- PROJECTID=1
- SUITEID=1
- ASSIGNEDTOID=1
- TESTRAIL_DOMAIN=XXX.testrail.io
- TESTRAIL_USERNAME=XXX
- TESTRAIL_PASSWORD=XXX
- TESTRAIL_PROJECTID=1
- TESTRAIL_SUITEID=1
- TESTRAIL_ASSIGNEDTOID=1
- Execute the build and test commands (unit and integration tests)
- Execute the e2e test (requires build and .env file)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mocha-testrail-reporter",
"version": "2.0.2",
"version": "2.0.5",
"description": "A Testrail reporter for mocha utilising TestRail API",
"main": "index.js",
"private": false,
Expand Down
12 changes: 6 additions & 6 deletions src/test/testrail.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { TestRailCase, Status } from "../lib/testrail.interface";
describe("TestRail API", () => {
it("Publish test run", (done) => {
let testRail = new TestRail({
domain: process.env.DOMAIN,
username: process.env.USERNAME,
password: process.env.PASSWORD,
projectId: process.env.PROJECTID,
suiteId: process.env.SUITEID,
assignedToId: process.env.ASSIGNEDTOID,
domain: process.env.TESTRAIL_DOMAIN,
username: process.env.TESTRAIL_USERNAME,
password: process.env.TESTRAIL_PASSWORD,
projectId: process.env.TESTRAIL_PROJECTID,
suiteId: process.env.TESTRAIL_SUITEID,
assignedToId: process.env.TESTRAIL_ASSIGNEDTOID,
});

testRail.fetchCases({}, (cases: TestRailCase[]) => {
Expand Down

0 comments on commit 57d1aa4

Please sign in to comment.