Browse Source

test(ui): Set environment on master branch + CI (#46547)

Scott Cooper 1 year ago
parent
commit
8571f04c82
1 changed files with 5 additions and 2 deletions
  1. 5 2
      jest.config.ts

+ 5 - 2
jest.config.ts

@@ -19,6 +19,8 @@ const {
   GITHUB_RUN_ATTEMPT,
 } = process.env;
 
+const IS_MASTER_BRANCH = GITHUB_PR_REF === 'refs/heads/master';
+
 const BALANCE_RESULTS_PATH = path.resolve(
   __dirname,
   'tests',
@@ -276,8 +278,9 @@ const config: Config.InitialOptions = {
       init: {
         // jest project under Sentry organization (dev productivity team)
         dsn: 'https://3fe1dce93e3a4267979ebad67f3de327@sentry.io/4857230',
-        environment: CI ? 'ci' : 'local',
-        tracesSampleRate: 1,
+        // Use production env to reduce sampling of commits on master
+        environment: CI ? (IS_MASTER_BRANCH ? 'ci:master' : 'ci:pull_request') : 'local',
+        tracesSampleRate: CI ? 1 : 0.5,
         profilesSampleRate: 0.1,
         transportOptions: {keepAlive: true},
       },