From 57d1aa48288bb14e65a034f8fe2424fc487bb9b8 Mon Sep 17 00:00:00 2001 From: Pierre Awaragi Date: Sun, 10 Apr 2022 18:48:46 -0400 Subject: [PATCH] Doc and test (#18) * 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 --- .github/workflows/{publish.yml => cd.yml} | 16 ++++++++-------- .github/workflows/ci.yml | 22 +++++++++++----------- .gitignore | 1 + .prettierignore | 1 + README.md | 12 ++++++------ package.json | 2 +- src/test/testrail.spec.ts | 12 ++++++------ 7 files changed, 34 insertions(+), 32 deletions(-) rename .github/workflows/{publish.yml => cd.yml} (61%) diff --git a/.github/workflows/publish.yml b/.github/workflows/cd.yml similarity index 61% rename from .github/workflows/publish.yml rename to .github/workflows/cd.yml index 305ee87d..2c1dfa82 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/cd.yml @@ -1,4 +1,4 @@ -name: Package and publish +name: Continuous Deploiment Package and Publish on: release: types: [published] @@ -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 }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a74769ed..b64db455 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 \ No newline at end of file + TESTRAIL_DOMAIN: ${{ secrets.DOMAIN }} + TESTRAIL_USERNAME: ${{ secrets.USERNAME }} + TESTRAIL_PASSWORD: ${{ secrets.PASSWORD }} + TESTRAIL_PROJECTID: 1 + TESTRAIL_SUITEID: 1 + TESTRAIL_ASSIGNEDTOID: 1 \ No newline at end of file diff --git a/.gitignore b/.gitignore index e78e2a69..d8f94703 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ node-debug* .c9/ *.iml .idea/ +*.sh dist .env *.tgz diff --git a/.prettierignore b/.prettierignore index 8d87b1d2..650b3597 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1,2 @@ +dist/ node_modules/* diff --git a/README.md b/README.md index ba0bb69f..80964c31 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/package.json b/package.json index c3423b41..7039476e 100644 --- a/package.json +++ b/package.json @@ -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, diff --git a/src/test/testrail.spec.ts b/src/test/testrail.spec.ts index c446b78e..3ab20e5c 100644 --- a/src/test/testrail.spec.ts +++ b/src/test/testrail.spec.ts @@ -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[]) => {