Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't validate limits outside of CI #1051

Merged
merged 2 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/common-integration-tests/src/auth-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 12 additions & 0 deletions packages/common-integration-tests/src/common-int-test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
malandis marked this conversation as resolved.
Show resolved Hide resolved
const itif = (condition: boolean) => (condition ? it : it.skip);
malandis marked this conversation as resolved.
Show resolved Hide resolved
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {v4} from 'uuid';
import {
expectWithMessage,
ItBehavesLikeItValidatesCacheName,
itOnlyInCi,
testCacheName,
ValidateCacheProps,
WithCache,
Expand Down Expand Up @@ -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();
Expand Down
Loading