diff --git a/lerna.json b/lerna.json index eded0d214d..e3e6aa1627 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.7.7-alpha.2", + "version": "2.7.7-alpha.3", "npmClient": "yarn", "packages": [ "packages/backend-core", diff --git a/packages/server/src/events/docUpdates/syncUsers.ts b/packages/server/src/events/docUpdates/syncUsers.ts index 7957178168..5777445249 100644 --- a/packages/server/src/events/docUpdates/syncUsers.ts +++ b/packages/server/src/events/docUpdates/syncUsers.ts @@ -26,6 +26,10 @@ export default function process(updateCb?: UpdateCallback) { // if something not found - no changes to perform if (err?.status === 404) { return + } + // The user has already been sync in another process + else if (err?.status === 409) { + return } else { logging.logAlert("Failed to perform user/group app sync", err) } diff --git a/qa-core/scripts/testResultsWebhook.js b/qa-core/scripts/testResultsWebhook.js index b4725cae56..40cc42082d 100644 --- a/qa-core/scripts/testResultsWebhook.js +++ b/qa-core/scripts/testResultsWebhook.js @@ -15,6 +15,12 @@ async function generateReport() { return JSON.parse(report) } +const env = process.argv.slice(2)[0] + +if (!env) { + throw new Error("environment argument is required") +} + async function discordResultsNotification(report) { const { numTotalTestSuites, @@ -39,8 +45,8 @@ async function discordResultsNotification(report) { content: `**Nightly Tests Status**: ${OUTCOME}`, embeds: [ { - title: "Budi QA Bot", - description: `Nightly Tests`, + title: `Budi QA Bot - ${env}`, + description: `API Integration Tests`, url: GITHUB_ACTIONS_RUN_URL, color: OUTCOME === "success" ? 3066993 : 15548997, timestamp: new Date(), diff --git a/qa-core/src/account-api/api/apis/AccountAPI.ts b/qa-core/src/account-api/api/apis/AccountAPI.ts index c18dde3d4a..54784814b7 100644 --- a/qa-core/src/account-api/api/apis/AccountAPI.ts +++ b/qa-core/src/account-api/api/apis/AccountAPI.ts @@ -60,8 +60,13 @@ export default class AccountAPI { } async delete(accountID: string) { - const [response, json] = await this.client.del(`/api/accounts/${accountID}`) - expect(response).toHaveStatusCode(200) + const [response, json] = await this.client.del(`/api/accounts/${accountID}`, { + internal: true, + }) + // can't use expect here due to use in global teardown + if (response.status !== 204) { + throw new Error(`Could not delete accountId=${accountID}`) + } return response } } diff --git a/qa-core/src/jest/globalTeardown.ts b/qa-core/src/jest/globalTeardown.ts index 51f6046f4f..52696a72f8 100644 --- a/qa-core/src/jest/globalTeardown.ts +++ b/qa-core/src/jest/globalTeardown.ts @@ -10,6 +10,7 @@ const API_OPTS: APIRequestOpts = { doExpect: false } async function deleteAccount() { // @ts-ignore const accountID = global.qa.accountId + // can't run 'expect' blocks in teardown await accountsApi.accounts.delete(accountID) }