From e296ef2dc101a7820d5044829335abdb40988a5f Mon Sep 17 00:00:00 2001 From: Frostebite Date: Sat, 18 Nov 2023 17:16:26 +0000 Subject: [PATCH] cleanup async parameter --- .eslintrc.json | 29 +++--------------- dist/index.js | Bin 22197719 -> 22197719 bytes dist/index.js.map | Bin 14672703 -> 14672605 bytes .../tests/cloud-runner-github-checks.test.ts | 4 +-- src/model/github.ts | 4 +-- .../Settings.json | 12 ++++---- 6 files changed, 15 insertions(+), 34 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 7ff0c589..ce2dfb06 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,22 +1,11 @@ { - "plugins": [ - "jest", - "@typescript-eslint", - "prettier", - "unicorn" - ], - "extends": [ - "plugin:unicorn/recommended", - "plugin:github/recommended", - "plugin:prettier/recommended" - ], + "plugins": ["jest", "@typescript-eslint", "prettier", "unicorn"], + "extends": ["plugin:unicorn/recommended", "plugin:github/recommended", "plugin:prettier/recommended"], "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": 2020, "sourceType": "module", - "extraFileExtensions": [ - ".mjs" - ], + "extraFileExtensions": [".mjs"], "ecmaFeatures": { "impliedStrict": true }, @@ -33,10 +22,7 @@ // Namespaces or sometimes needed "import/no-namespace": "off", // Properly format comments - "spaced-comment": [ - "error", - "always" - ], + "spaced-comment": ["error", "always"], "lines-around-comment": [ "error", { @@ -71,12 +57,7 @@ // Enforce camelCase "camelcase": "error", // Allow forOfStatements - "no-restricted-syntax": [ - "error", - "ForInStatement", - "LabeledStatement", - "WithStatement" - ], + "no-restricted-syntax": ["error", "ForInStatement", "LabeledStatement", "WithStatement"], // Continue is viable in forOf loops in generators "no-continue": "off", // From experience, named exports are almost always desired. I got tired of this rule diff --git a/dist/index.js b/dist/index.js index f4883cbc9f7c80ae19acb57fbf5c62713be379e4..11c20c3e02cdc8145649028c531cbfae68f8cdd8 100644 GIT binary patch delta 1458 zcmWmE_g4-80EOXGN~uIiB}q$!mWDzp4W+X8CXp4&-s2-=@4fflo9sO^viIJ5ulN4& zy#K&G=jOdSZIOqe1|x&9A>THWqiNRdyJe)LMrHO(PpO}p*)uCQ%><^%4>Opf04!h$ zD-?t^3ZXD;V2dKKLs8hn0gfmJClrS>O27pr;R-jn!vmfu1uv9F8F-^C%Aq`b;0r(a zBLEc;h#&+b1QijAFjPWiR6#f*P!*AgLN!Dq2C;}kb;Kh9HIRrTB%>y3p*HHEF6yB^ z8lWK>p)s1EDVm`cFP2#c`vcx3ahaOYq1XNu>l*g37fG6Td@t>u>(7?3%jugd$AAu zaR50uh(kDxBRGmnlAzR35|tz+S*fYiQfe!8jB+>>Bh%#nWhd&n delta 1458 zcmWmE=T{B@0EO}MQdH6+qY_$DnJo$>N}H_gJzk0sl07oB_uhMt?7jEO$lg19Z=U<% z_xuC*oSTz-#v%tpGYlDdGV*4b95Y(AO-=9KJ~5?NQm5pUwA9hrMiZDKAM(Qt=CD8k zSfU`TU=17C!VZN{81^WFq9}&qaDXG6Py)^Mx}iH#&;vcu3)-(Y`k*h; z&=2Y8j{z8nK^Tl77>Z#SjuFVfNQ}a0jKNrpLng*!0w!V-CSwYwVj8An24-RwW@8TK zVjkvW0TyBr7GnvPVi}fW1y*7eR$~p;Vjb3F12$q4He(C6VjHrs9XqfSyRaL3uowHV z9|v#{hj182a1_UI94BxRr*Il)a2Drq9v5&Cmv9-`xPq&=hU>_|4cx>n+{PW;#Xa1| z13bhdJjN3|#WOs|3%tZDsi;&^Dl5KPihIL%R$`P`B~FP~>MHe=1j9iN#b6ruAH_uK A_y7O^ diff --git a/dist/index.js.map b/dist/index.js.map index 6630b62fb99cc6b36dc79e48b3703f48609f4889..53ba6ed6fa09995f58938a72808c50c8356c7c9f 100644 GIT binary patch delta 1325 zcmY+=`BT(&7{Ku%Wi`-6LInkRzAAF07>8yarK@FGA|B+4X2KetsEB74>PN96wJaVj zDHUa5*Og<@^)^W{)5@#7@|bBFe{06S0N=~b(D=h^=6SxybDe8$u|2rhVk0%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%FORy9<$b}QjupGfz z=HXkcz)GybcUX-zSc`nD!+LB$0XCu#o1m~6TTq0p*oN=19XqfSyRaL3uopkzN9@CX z`~-~yIEbI|3x35R9L5nG#W5Vm37o_!oQ4}76r%)Ql%fo0P!1m|PzgWI;vCK+fGS+T zMf`@}@dy4yH7?;YuHY)J;W}>MFWkf}+{WMd2X|0|ySRt@sKo<3#3MY$6FkK;JjV;X OL>=k__J~*25B~$eP1{cZ diff --git a/src/model/cloud-runner/tests/cloud-runner-github-checks.test.ts b/src/model/cloud-runner/tests/cloud-runner-github-checks.test.ts index 652533f5..19f7c828 100644 --- a/src/model/cloud-runner/tests/cloud-runner-github-checks.test.ts +++ b/src/model/cloud-runner/tests/cloud-runner-github-checks.test.ts @@ -39,11 +39,11 @@ describe('Cloud Runner Github Checks', () => { asyncCloudRunner: `true`, githubChecks: `true`, }); - GitHub.asyncWorkflows = true; + GitHub.forceAsyncTest = true; await CloudRunner.setup(buildParameter); CloudRunner.buildParameters.githubCheckId = await GitHub.createGitHubCheck(`t`); await GitHub.updateGitHubCheck(`t`, `t2`); - GitHub.asyncWorkflows = false; + GitHub.forceAsyncTest = false; }, 1_000_000_000); } }); diff --git a/src/model/github.ts b/src/model/github.ts index 82fdc3ad..0dd18637 100644 --- a/src/model/github.ts +++ b/src/model/github.ts @@ -11,7 +11,7 @@ class GitHub { private static startedDate: string; private static endedDate: string; static result: string = ``; - static asyncWorkflows: boolean; + static forceAsyncTest: boolean; private static get octokitDefaultToken() { return new Octokit({ auth: process.env.GITHUB_TOKEN, @@ -128,7 +128,7 @@ class GitHub { data.conclusion = result; } - await (CloudRunner.isCloudRunnerAsyncEnvironment || GitHub.asyncWorkflows + await (CloudRunner.isCloudRunnerAsyncEnvironment || GitHub.forceAsyncTest ? GitHub.runUpdateAsyncChecksWorkflow(data, `update`) : GitHub.updateGitHubCheckRequest(data)); } diff --git a/test-project/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json b/test-project/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json index ad11087f..757e1a0a 100644 --- a/test-project/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json +++ b/test-project/ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json @@ -1,7 +1,7 @@ { - "m_Name": "Settings", - "m_Path": "ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json", - "m_Dictionary": { - "m_DictionaryValues": [] - } -} \ No newline at end of file + "m_Name": "Settings", + "m_Path": "ProjectSettings/Packages/com.unity.testtools.codecoverage/Settings.json", + "m_Dictionary": { + "m_DictionaryValues": [] + } +}