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(api-headless-cms-import-export): set larger timeout on tests #4316

Merged
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
4 changes: 4 additions & 0 deletions .github/workflows/pullRequests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ jobs:
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
AWS_REGION: eu-central-1
steps:
- uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -245,6 +246,7 @@ jobs:
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
AWS_REGION: eu-central-1
steps:
- uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -306,6 +308,7 @@ jobs:
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
AWS_REGION: eu-central-1
AWS_ELASTIC_SEARCH_DOMAIN_NAME: ${{ secrets.AWS_ELASTIC_SEARCH_DOMAIN_NAME }}
ELASTIC_SEARCH_ENDPOINT: ${{ secrets.ELASTIC_SEARCH_ENDPOINT }}
ELASTIC_SEARCH_INDEX_PREFIX: ${{ matrix.package.id }}
Expand Down Expand Up @@ -378,6 +381,7 @@ jobs:
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
AWS_REGION: eu-central-1
AWS_ELASTIC_SEARCH_DOMAIN_NAME: ${{ secrets.AWS_OPEN_SEARCH_DOMAIN_NAME }}
ELASTIC_SEARCH_ENDPOINT: ${{ secrets.OPEN_SEARCH_ENDPOINT }}
ELASTIC_SEARCH_INDEX_PREFIX: ${{ matrix.package.id }}
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/pushDev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ jobs:
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
AWS_REGION: eu-central-1
steps:
- uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -211,6 +212,7 @@ jobs:
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
AWS_REGION: eu-central-1
steps:
- uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -272,6 +274,7 @@ jobs:
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
AWS_REGION: eu-central-1
AWS_ELASTIC_SEARCH_DOMAIN_NAME: ${{ secrets.AWS_ELASTIC_SEARCH_DOMAIN_NAME }}
ELASTIC_SEARCH_ENDPOINT: ${{ secrets.ELASTIC_SEARCH_ENDPOINT }}
ELASTIC_SEARCH_INDEX_PREFIX: ${{ matrix.package.id }}
Expand Down Expand Up @@ -343,6 +346,7 @@ jobs:
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
AWS_REGION: eu-central-1
AWS_ELASTIC_SEARCH_DOMAIN_NAME: ${{ secrets.AWS_OPEN_SEARCH_DOMAIN_NAME }}
ELASTIC_SEARCH_ENDPOINT: ${{ secrets.OPEN_SEARCH_ENDPOINT }}
ELASTIC_SEARCH_INDEX_PREFIX: ${{ matrix.package.id }}
Expand Down Expand Up @@ -481,8 +485,8 @@ jobs:
npx create-webiny-project@local-npm new-webiny-project --tag local-npm
--no-interactive --assign-to-yarnrc
'{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}'
--template-options '{"region":"${{ env.AWS_REGION
}}","storageOperations":"ddb"}'
--template-options
'{"region":"eu-central-1","storageOperations":"ddb"}'
- name: Print CLI version
working-directory: new-webiny-project
run: yarn webiny --version
Expand Down Expand Up @@ -688,8 +692,8 @@ jobs:
npx create-webiny-project@local-npm new-webiny-project --tag local-npm
--no-interactive --assign-to-yarnrc
'{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}'
--template-options '{"region":"${{ env.AWS_REGION
}}","storageOperations":"ddb-es"}'
--template-options
'{"region":"eu-central-1","storageOperations":"ddb-es"}'
- name: Print CLI version
working-directory: new-webiny-project
run: yarn webiny --version
Expand Down Expand Up @@ -900,8 +904,8 @@ jobs:
npx create-webiny-project@local-npm new-webiny-project --tag local-npm
--no-interactive --assign-to-yarnrc
'{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}'
--template-options '{"region":"${{ env.AWS_REGION
}}","storageOperations":"ddb-os"}'
--template-options
'{"region":"eu-central-1","storageOperations":"ddb-os"}'
- name: Print CLI version
working-directory: new-webiny-project
run: yarn webiny --version
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/pushNext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ jobs:
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
AWS_REGION: eu-central-1
steps:
- uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -211,6 +212,7 @@ jobs:
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
AWS_REGION: eu-central-1
steps:
- uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -272,6 +274,7 @@ jobs:
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
AWS_REGION: eu-central-1
AWS_ELASTIC_SEARCH_DOMAIN_NAME: ${{ secrets.AWS_ELASTIC_SEARCH_DOMAIN_NAME }}
ELASTIC_SEARCH_ENDPOINT: ${{ secrets.ELASTIC_SEARCH_ENDPOINT }}
ELASTIC_SEARCH_INDEX_PREFIX: ${{ matrix.package.id }}
Expand Down Expand Up @@ -343,6 +346,7 @@ jobs:
env:
NODE_OPTIONS: '--max_old_space_size=4096'
YARN_ENABLE_IMMUTABLE_INSTALLS: false
AWS_REGION: eu-central-1
AWS_ELASTIC_SEARCH_DOMAIN_NAME: ${{ secrets.AWS_OPEN_SEARCH_DOMAIN_NAME }}
ELASTIC_SEARCH_ENDPOINT: ${{ secrets.OPEN_SEARCH_ENDPOINT }}
ELASTIC_SEARCH_INDEX_PREFIX: ${{ matrix.package.id }}
Expand Down Expand Up @@ -481,8 +485,8 @@ jobs:
npx create-webiny-project@local-npm new-webiny-project --tag local-npm
--no-interactive --assign-to-yarnrc
'{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}'
--template-options '{"region":"${{ env.AWS_REGION
}}","storageOperations":"ddb"}'
--template-options
'{"region":"eu-central-1","storageOperations":"ddb"}'
- name: Print CLI version
working-directory: new-webiny-project
run: yarn webiny --version
Expand Down Expand Up @@ -688,8 +692,8 @@ jobs:
npx create-webiny-project@local-npm new-webiny-project --tag local-npm
--no-interactive --assign-to-yarnrc
'{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}'
--template-options '{"region":"${{ env.AWS_REGION
}}","storageOperations":"ddb-es"}'
--template-options
'{"region":"eu-central-1","storageOperations":"ddb-es"}'
- name: Print CLI version
working-directory: new-webiny-project
run: yarn webiny --version
Expand Down Expand Up @@ -900,8 +904,8 @@ jobs:
npx create-webiny-project@local-npm new-webiny-project --tag local-npm
--no-interactive --assign-to-yarnrc
'{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}'
--template-options '{"region":"${{ env.AWS_REGION
}}","storageOperations":"ddb-os"}'
--template-options
'{"region":"eu-central-1","storageOperations":"ddb-os"}'
- name: Print CLI version
working-directory: new-webiny-project
run: yarn webiny --version
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/wac/pullRequests.wac.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { createWorkflow, NormalJob } from "github-actions-wac";
import { createJob } from "./jobs";
import { NODE_VERSION, BUILD_PACKAGES_RUNNER, listPackagesWithJestTests } from "./utils";
import {
NODE_VERSION,
BUILD_PACKAGES_RUNNER,
listPackagesWithJestTests,
AWS_REGION
} from "./utils";
import {
createGlobalBuildCacheSteps,
createInstallBuildSteps,
Expand All @@ -18,7 +23,7 @@ const globalBuildCacheSteps = createGlobalBuildCacheSteps({ workingDirectory: DI
const runBuildCacheSteps = createRunBuildCacheSteps({ workingDirectory: DIR_WEBINY_JS });

const createJestTestsJob = (storage: string | null) => {
const env: Record<string, string> = {};
const env: Record<string, string> = { AWS_REGION };

if (storage) {
if (storage === "ddb-es") {
Expand Down Expand Up @@ -292,7 +297,7 @@ export const pullRequests = createWorkflow({
},
{
name: "Create a new Webiny project",
run: 'npx create-webiny-project@local-npm test-project --tag local-npm --no-interactive --assign-to-yarnrc \'{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}\' --template-options \'{"region":"eu-central-1"}\'\n'
run: `npx create-webiny-project@local-npm test-project --tag local-npm --no-interactive --assign-to-yarnrc \'{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}\' --template-options \'{"region":"${AWS_REGION}"}\'\n`
}
]
})
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wac/pullRequestsCommandCypress.wac.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
createGlobalBuildCacheSteps,
createRunBuildCacheSteps
} from "./steps";
import { NODE_OPTIONS, NODE_VERSION, BUILD_PACKAGES_RUNNER } from "./utils";
import { NODE_OPTIONS, NODE_VERSION, BUILD_PACKAGES_RUNNER, AWS_REGION } from "./utils";
import { createJob, createValidateWorkflowsJob } from "./jobs";

// Will print "next" or "dev". Important for caching (via actions/cache).
Expand Down Expand Up @@ -212,7 +212,7 @@ export const pullRequestsCommandCypress = createWorkflow({
on: "issue_comment",
env: {
NODE_OPTIONS,
AWS_REGION: "eu-central-1"
AWS_REGION
},
jobs: {
checkComment: createJob({
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/wac/push.wac.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { createWorkflow, NormalJob } from "github-actions-wac";
import { BUILD_PACKAGES_RUNNER, listPackagesWithJestTests, NODE_VERSION } from "./utils";
import {
AWS_REGION,
BUILD_PACKAGES_RUNNER,
listPackagesWithJestTests,
NODE_VERSION
} from "./utils";
import { createJob } from "./jobs";
import {
createDeployWebinySteps,
Expand Down Expand Up @@ -126,7 +131,7 @@ const createPushWorkflow = (branchName: string) => {
},
{
name: "Create a new Webiny project",
run: `npx create-webiny-project@local-npm ${DIR_TEST_PROJECT} --tag local-npm --no-interactive --assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}' --template-options '{"region":"$\{{ env.AWS_REGION }}","storageOperations":"${dbSetup}"}'
run: `npx create-webiny-project@local-npm ${DIR_TEST_PROJECT} --tag local-npm --no-interactive --assign-to-yarnrc '{"npmRegistryServer":"http://localhost:4873","unsafeHttpWhitelist":["localhost"]}' --template-options '{"region":"${AWS_REGION}","storageOperations":"${dbSetup}"}'
`
},
{
Expand Down Expand Up @@ -214,9 +219,7 @@ const createPushWorkflow = (branchName: string) => {
};

const createJestTestsJob = (storage: string | null) => {
const env: Record<string, string> = {
region: "${{ secrets.AWS_REGION }}"
};
const env: Record<string, string> = { AWS_REGION };

if (storage) {
if (storage === "ddb-es") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ export const createMappingsSnapshot = () => {
return {
mappings: {
dynamic_templates: [
{
ids: {
match: "^id|entryId$",
mapping: {
type: "string",
keyword: true
}
}
},
{
dates: {
match: "^createdOn|savedOn|publishedOn$",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import {
import { categoryModel } from "~tests/helpers/models";
import { NonEmptyArray } from "@webiny/api/types";

jest.setTimeout(60000);

describe("import from url controller", () => {
let context: Context;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import { GenericRecord } from "@webiny/api/types";
const cloudfrontUrl = "https://d1zqvydzhnfn89.cloudfront.net";

describe("match key or alias", () => {
beforeEach(() => {
process.env.DEBUG = "true";
});

it("should log an error when given an invalid URL", () => {
const errors: any[] = [];
console.error = (...args: any[]) => {
Expand Down
Loading