add pull request ID

This commit is contained in:
yasserfaraazkhan 2024-02-09 02:08:26 +05:30
parent a7628e1728
commit 35c3ddff78
2 changed files with 29 additions and 6 deletions

View file

@ -39,7 +39,7 @@ env:
MM_TEST_SERVER_URL: ${{ secrets.MM_DESKTOP_E2E_SERVER_URL }} MM_TEST_SERVER_URL: ${{ secrets.MM_DESKTOP_E2E_SERVER_URL }}
MM_TEST_USER_NAME: ${{ secrets.MM_DESKTOP_E2E_USER_NAME }} MM_TEST_USER_NAME: ${{ secrets.MM_DESKTOP_E2E_USER_NAME }}
MM_TEST_PASSWORD: ${{ secrets.MM_DESKTOP_E2E_USER_CREDENTIALS }} MM_TEST_PASSWORD: ${{ secrets.MM_DESKTOP_E2E_USER_CREDENTIALS }}
PULL_REQUEST_BASE_URL: "https://github.com/mattermost/desktop/pull/" PULL_REQUEST: "https://github.com/mattermost/desktop/pull/${{ github.event.number }}"
ZEPHYR_ENVIRONMENT_NAME: 'Desktop app' ZEPHYR_ENVIRONMENT_NAME: 'Desktop app'
ZEPHYR_FOLDER_ID: "3256491" ZEPHYR_FOLDER_ID: "3256491"
TEST_CYCLE_LINK_PREFIX: ${{ secrets.MM_DESKTOP_E2E_TEST_CYCLE_LINK_PREFIX }} TEST_CYCLE_LINK_PREFIX: ${{ secrets.MM_DESKTOP_E2E_TEST_CYCLE_LINK_PREFIX }}
@ -75,7 +75,7 @@ jobs:
- name: ci/checkout-repo - name: ci/checkout-repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: ci/setup-node - name: ci/setup-node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 uses: actions/setup-node@v4
with: with:
node-version-file: "package.json" node-version-file: "package.json"
cache: "npm" cache: "npm"
@ -147,7 +147,7 @@ jobs:
- name: ci/checkout-repo - name: ci/checkout-repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: ci/setup-node - name: ci/setup-node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 uses: actions/setup-node@v4
with: with:
node-version-file: "package.json" node-version-file: "package.json"
cache: "npm" cache: "npm"
@ -232,7 +232,7 @@ jobs:
- name: ci/checkout-repo - name: ci/checkout-repo
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: ci/setup-node - name: ci/setup-node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 uses: actions/setup-node@v4
with: with:
node-version-file: "package.json" node-version-file: "package.json"
cache: "npm" cache: "npm"

View file

@ -83,13 +83,36 @@ function saveToEndpoint(url, data) {
}); });
} }
async function getZEPHYRFolderID() {
const {
ZEPHYR_FOLDER_ID,
} = process.env;
const platform = os.platform();
let folderID;
switch (platform) {
case 'darwin':
folderID = 12358650;
break;
case 'win32':
folderID = 12358651;
break;
case 'linux':
folderID = 12358649;
break;
default:
folderID = ZEPHYR_FOLDER_ID;
}
return folderID;
}
async function createTestCycle(startDate, endDate) { async function createTestCycle(startDate, endDate) {
const { const {
BRANCH, BRANCH,
BUILD_ID, BUILD_ID,
JIRA_PROJECT_KEY, JIRA_PROJECT_KEY,
ZEPHYR_CYCLE_NAME, ZEPHYR_CYCLE_NAME,
ZEPHYR_FOLDER_ID,
} = process.env; } = process.env;
const testCycle = { const testCycle = {
@ -99,7 +122,7 @@ async function createTestCycle(startDate, endDate) {
plannedStartDate: startDate, plannedStartDate: startDate,
plannedEndDate: endDate, plannedEndDate: endDate,
statusName: 'Done', statusName: 'Done',
folderId: ZEPHYR_FOLDER_ID, folderId: getZEPHYRFolderID(),
}; };
const response = await saveToEndpoint('https://api.zephyrscale.smartbear.com/v2/testcycles', testCycle); const response = await saveToEndpoint('https://api.zephyrscale.smartbear.com/v2/testcycles', testCycle);