diff --git a/packages/common-integration-tests/src/auth-client.ts b/packages/common-integration-tests/src/auth-client.ts index c0b8d1131..9b8ac965d 100644 --- a/packages/common-integration-tests/src/auth-client.ts +++ b/packages/common-integration-tests/src/auth-client.ts @@ -65,7 +65,8 @@ export function runAuthClientTests( ); }); - it('should succeed for generating an api token that expires', async () => { + // this test is sensitive to clock skew inside of github actions, skipping it for now + it.skip('should succeed for generating an api token that expires', async () => { const secondsSinceEpoch = Math.round(Date.now() / 1000); const expireResponse = await sessionTokenAuthClient.generateApiKey( SUPER_USER_PERMISSIONS, diff --git a/packages/common-integration-tests/src/common-int-test-utils.ts b/packages/common-integration-tests/src/common-int-test-utils.ts index 887f2d5ba..9016727ea 100644 --- a/packages/common-integration-tests/src/common-int-test-utils.ts +++ b/packages/common-integration-tests/src/common-int-test-utils.ts @@ -21,6 +21,18 @@ import { import {v4} from 'uuid'; import {ITopicClient} from '@gomomento/sdk-core/dist/src/clients/ITopicClient'; +const isInsideGithubCI = process.env.CI === 'true'; +const itif = (condition: boolean) => (condition ? it : it.skip); +const maybe = (condition: boolean) => (condition ? describe : describe.skip); +/** + * Only runs the tests inside the 'it' block if inside a continuous integration environment. + */ +export const itOnlyInCi = itif(isInsideGithubCI); +/** + * Only runs the test inside the 'describe' block if inside a continuous integration environment. + */ +export const describeOnlyInCi = maybe(isInsideGithubCI); + export function isLocalhostDevelopmentMode(): boolean { const useLocalhost = process.env.MOMENTO_SDK_TESTS_USE_LOCALHOST; return useLocalhost !== undefined; diff --git a/packages/common-integration-tests/src/create-delete-list-cache.ts b/packages/common-integration-tests/src/create-delete-list-cache.ts index 480ddcda5..f64bf959a 100644 --- a/packages/common-integration-tests/src/create-delete-list-cache.ts +++ b/packages/common-integration-tests/src/create-delete-list-cache.ts @@ -2,6 +2,7 @@ import {v4} from 'uuid'; import { expectWithMessage, ItBehavesLikeItValidatesCacheName, + itOnlyInCi, testCacheName, ValidateCacheProps, WithCache, @@ -48,7 +49,7 @@ export function runCreateDeleteListCacheTests(cacheClient: ICacheClient) { }); }); - it('should create 1 cache and list the created cache', async () => { + itOnlyInCi('should create 1 cache and list the created cache', async () => { const cacheName = testCacheName(); await WithCache(cacheClient, cacheName, async () => { const listResponse = await cacheClient.listCaches();