Skip to content

Commit

Permalink
Add testrail
Browse files Browse the repository at this point in the history
  • Loading branch information
Tung-Huynh-Shopmacher committed Jul 19, 2024
1 parent 3e1a911 commit 2597396
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 5 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,25 @@ jobs:
- name: Run tests
run: npm run test

- name: Python setup
if: always()
uses: actions/setup-python@v3
with:
python-version: '3.x'

- name: TestRail CLI upload results
if: always()
run: |
pip install trcli
trcli -y \
-h "https://$TR_INSTANCE.testrail.io" \
--project "$TR_PROJECT_NAME" \
-u TR_USER_EMAIL \
-p TR_PASSWORD \
parse_junit \
--title "Automated Tests Mollie Connector" \
--run-description ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \
-f "junit-report.xml"
- name: Run audit
run: npm audit
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ dist
.vscode
.idea
build/
processor/.env
processor/.env
processor/junit-report.xml
3 changes: 2 additions & 1 deletion processor/jest.config.cjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
module.exports = {
displayName: 'Tests Typescript Application - shopmacher-mollie-processor',
displayName: 'Tests Mollie connector - shopmacher-mollie-connector',
moduleDirectories: ['node_modules', 'src'],
testMatch: ['**/tests/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[tj]s?(x)'],
preset: 'ts-jest',
testEnvironment: 'node',
setupFiles: ['<rootDir>/src/jest.setup.ts'],
setupFilesAfterEnv: ['<rootDir>/src/jest.setupAfterEnv.ts'],
modulePathIgnorePatterns: ['<rootDir>/src/jest.setup.ts'],
reporters: ['default', 'jest-junit']
};
47 changes: 45 additions & 2 deletions processor/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion processor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"lint": "eslint . --ext .ts",
"prettier": "prettier --write '**/*.{js,ts}'",
"prettier:check": "prettier --check '**/*.{js,ts}'",
"test": "jest --detectOpenHandles --clearMocks --colors --config jest.config.cjs",
"test": "jest --detectOpenHandles --clearMocks --colors --config jest.config.cjs --ci --testResultsProcessor=jest-junit",
"test:watch": "jest --watch --clearMocks --detectOpenHandles --colors --config jest.config.cjs",
"preinstall": "npx npm-force-resolutions",
"connector:post-deploy": "node dist/connector/post-deploy.js",
Expand Down Expand Up @@ -51,6 +51,7 @@
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-unused-imports": "3.2.0",
"jest": "^29.7.0",
"jest-junit": "^16.0.0",
"ngrok": "^5.0.0-beta.2",
"nodemon": "^3.1.4",
"npm-force-resolutions": "^0.0.10",
Expand All @@ -72,5 +73,15 @@
"proxy-from-env": "^1.1.0",
"uuid": "^10.0.0",
"validator": "^13.12.0"
},
"jest-junit": {
"suiteName": "jest tests",
"outputDirectory": ".",
"outputName": "junit-report.xml",
"uniqueOutputName": "false",
"classNameTemplate": "{classname}-{title}",
"titleTemplate": "{classname}-{title}",
"ancestorSeparator": "",
"usePathForSuiteName": "true"
}
}

0 comments on commit 2597396

Please sign in to comment.