Skip to content

Commit

Permalink
Add a local env variable allowing us to skip performance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
harriswong committed Jun 29, 2022
1 parent 4e5e2d0 commit b4ca77c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ If you wish to skip E2E tests for WC Subscriptions, Action Scheduler or WC Guten
SKIP_WC_SUBSCRIPTIONS_TESTS=1
SKIP_WC_ACTION_SCHEDULER_TESTS=1
SKIP_WC_BLOCKS_TESTS=1
SKIP_WC_PERFORMANCE_TESTS=1
```

</p>
Expand Down
9 changes: 7 additions & 2 deletions tests/e2e/specs/performance/payment-methods.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@ const { merchant } = require( '@woocommerce/e2e-utils' );
* Internal dependencies
*/
import { setupProductCheckout } from '../../utils/payments';
import { shopperWCP, merchantWCP } from '../../utils';
import {
shopperWCP,
merchantWCP,
describeif,
RUN_WC_PERFORMANCE_TESTS,
} from '../../utils';
import {
recreatePerformanceFile,
logPerformanceResult,
measureCheckoutMetrics,
averageMetrics,
} from '../../utils/performance';

describe( 'Checkout page performance', () => {
describeif( RUN_WC_PERFORMANCE_TESTS )( 'Checkout page performance', () => {
beforeAll( async () => {
// Start a new file for every run.
recreatePerformanceFile();
Expand Down
3 changes: 3 additions & 0 deletions tests/e2e/utils/flows.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ export const RUN_ACTION_SCHEDULER_TESTS =

export const RUN_WC_BLOCKS_TESTS = '1' !== process.env.SKIP_WC_BLOCKS_TESTS;

export const RUN_WC_PERFORMANCE_TESTS =
'1' !== process.env.SKIP_WC_PERFORMANCE_TESTS;

// The generic flows will be moved to their own package soon (more details in p7bje6-2gV-p2), so we're
// keeping our customizations grouped here so it's easier to extend the flows once the move happens.
export const shopperWCP = {
Expand Down

0 comments on commit b4ca77c

Please sign in to comment.