Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
jacqueline-57b committed Jul 25, 2024
1 parent cc9c950 commit f9cde59
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 18 deletions.
41 changes: 26 additions & 15 deletions .github/workflows/run-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Run E2E Test

on:
push:
branches: [ "add-workflow-2" ]
branches: [ "add-workflow-2", "refactor-report"]

pull_request:
branches: [ "main" ]
Expand All @@ -20,6 +20,12 @@ jobs:
steps:
- name: Check Out Repository Code
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
Expand Down Expand Up @@ -61,25 +67,30 @@ jobs:
with:
name: sdk-sepolia-test-report
path: |
./test-reports
./allure-results
if: always()

- name: Copy report to date folder
id: create_folder
run: |
folder_name=$(date +%Y%m%d)
echo "Folder name: $folder_name"
mkdir -p ./tmp/$folder_name
cp -R ./test-reports/* ./tmp/$folder_name
cp -R ./template/l1-test-report-template.html ./tmp/$folder_name/l1-test-report.html
# Deploy report to GitHub Pages
- name: Deploy report to GitHub Pages
- name: Load test report history
uses: actions/checkout@v3
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages

- name: Build test report
uses: simple-elf/[email protected]
if: always()
with:
gh_pages: gh-pages
allure_history: allure-history
allure_results: build/allure-results

- name: Publish test report
uses: peaceiris/actions-gh-pages@v4
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./tmp
publish_branch: gh-pages
keep_files: true
publish_dir: allure-history
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"scripts": {
"test:sepolia:smoke": "env TEST_ENV='sepolia' mocha -r ts-node/register -r mocha-steps --grep '\\[smoke\\]' './test/**/**/*.test.ts' --timeout 240000 --reporter mochawesome --reporter-options reportDir='test-reports',reportFilename='[status]_[datetime]_sdk-test-report',timestamp='mm-dd-yyyy_HHMMss',reportTitle='SDK Test Report'",
"test:story:smoke": "env TEST_ENV='storyTestnet' mocha -r ts-node/register -r mocha-steps --grep '\\[smoke\\]' './test/**/**/*.test.ts' --timeout 240000 --reporter mochawesome --reporter-options reportDir='test-reports',reportFilename='[status]_[datetime]_sdk-test-report',timestamp='mm-dd-yyyy_HHMMss',reportTitle='SDK Test Report'",
"test:sepolia:e2e": "env TEST_ENV='sepolia' mocha -r ts-node/register -r mocha-steps './test/**/e2e/*.test.ts' --timeout 240000 --reporter mochawesome --reporter-options reportDir='test-reports',reportFilename='[status]_[datetime]_sdk-test-report',timestamp='mm-dd-yyyy_HHMMss',reportTitle='SDK Test Report'",
"test:story:e2e": "env TEST_ENV='storyTestnet' mocha -r ts-node/register -r mocha-steps './test/**/e2e/*.test.ts' --timeout 240000 --reporter mochawesome --reporter-options reportDir='test-reports',reportFilename='[status]_[datetime]_sdk-test-report',timestamp='mm-dd-yyyy_HHMMss',reportTitle='SDK Test Report'",
"test:sepolia:e2e": "env TEST_ENV='sepolia' mocha -r ts-node/register -r mocha-steps './test/**/e2e/*.test.ts' --timeout 240000 --reporter allure-mocha --reporter-options reportDir='test-reports',reportFilename='[status]_[datetime]_sdk-test-report',timestamp='mm-dd-yyyy_HHMMss',reportTitle='SDK Test Report'",
"test:story:e2e": "env TEST_ENV='storyTestnet' mocha -r ts-node/register -r mocha-steps './test/**/e2e/*.test.ts' --timeout 240000 --reporter allure-mocha --reporter-options reportDir='test-reports',reportFilename='[status]_[datetime]_sdk-test-report',timestamp='mm-dd-yyyy_HHMMss',reportTitle='SDK Test Report'",
"test:sepolia": "env TEST_ENV='sepolia' mocha -r ts-node/register -r mocha-steps './test/**/**/**.test.ts' --timeout 240000 --reporter mochawesome --reporter-options reportDir='test-reports',reportFilename='[status]_[datetime]_sdk-test-report',timestamp='mm-dd-yyyy_HHMMss',reportTitle='SDK Test Report'",
"test:story": "env TEST_ENV='storyTestnet' mocha -r ts-node/register -r mocha-steps './test/**/**/*.test.ts' --timeout 240000 --reporter mochawesome --reporter-options reportDir='test-reports',reportFilename='[status]_[datetime]_sdk-test-report',timestamp='mm-dd-yyyy_HHMMss',reportTitle='SDK Test Report'",
"open:report": "open test-reports/*.html",
Expand All @@ -29,6 +29,8 @@
"@types/mochawesome": "^6.2.4",
"@types/node": "^20.8.2",
"@types/sinon": "^10.0.18",
"allure-commandline": "^2.29.0",
"allure-mocha": "^3.0.0-beta.7",
"chai": "^4.3.10",
"chai-as-promised": "^7.1.1",
"eslint": "^8.50.0",
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/derivativeIP.comRemixPIL.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let licenseTokenIdB: string;
const waitForTransaction: boolean = true;

describe("SDK E2E Test - Register Derivative IP Asset with Commercial Remix PIL", function () {
describe("@smoke Register a derivative IP asset with/without license tokens", async function () {
describe.only("@smoke Register a derivative IP asset with/without license tokens", async function () {
step("Mint a NFT to Wallet A and get a tokenId (tokenIdA)", async function () {
tokenIdA = await mintNFTWithRetry(privateKeyA);
checkMintResult(tokenIdA);
Expand Down

0 comments on commit f9cde59

Please sign in to comment.