Skip to content

Commit

Permalink
fix: table names in multiple test configurations (#1995)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunozoric committed Oct 27, 2021
1 parent 4e63c3c commit 83d6ff5
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 9 deletions.
Expand Up @@ -18,7 +18,7 @@ const getStorageOperationsPlugins = ({ documentClient }) => {
...dynamoDbPlugins(),
...plugins(),
...dbPlugins({
table: "FileManager",
table: process.env.DB_TABLE,
driver: new DynamoDbDriver({
documentClient
})
Expand Down
@@ -1,7 +1,7 @@
module.exports = {
tables: [
{
TableName: `DynamoDB`,
TableName: process.env.DB_TABLE,
KeySchema: [
{ AttributeName: "PK", KeyType: "HASH" },
{ AttributeName: "SK", KeyType: "RANGE" }
Expand Down
Expand Up @@ -40,7 +40,7 @@ const getStorageOperationsPlugins = ({
elasticsearchDataGzipCompression(),
plugins(),
dbPlugins({
table: "HeadlessCms",
table: process.env.DB_TABLE,
driver: new DynamoDbDriver({
documentClient
})
Expand Down
12 changes: 10 additions & 2 deletions packages/api-headless-cms/__tests__/contentAPI/references.test.ts
Expand Up @@ -376,7 +376,11 @@ describe("entry references", () => {
return !!entry.meta.publishedOn;
});
},
{ name: "list all published articles", tries: 10 }
{
name: "list all published articles",
tries: 20,
wait: 400
}
);

const [listManageResponse] = await articleManager.listArticles();
Expand Down Expand Up @@ -457,7 +461,11 @@ describe("entry references", () => {
const entries = data?.listCategories?.data || [];
return entries.length === 0;
},
{ name: "list all categories after delete", tries: 10 }
{
name: "list all categories after delete",
tries: 20,
wait: 400
}
);

const [listAfterDeleteManageResponse] = await articleManager.listArticles();
Expand Down
@@ -1,7 +1,7 @@
module.exports = {
tables: [
{
TableName: `DynamoDB`,
TableName: process.env.DB_TABLE,
KeySchema: [
{ AttributeName: "PK", KeyType: "HASH" },
{ AttributeName: "SK", KeyType: "RANGE" }
Expand Down
2 changes: 1 addition & 1 deletion packages/api-security-so-ddb/jest-dynalite-config.js
@@ -1,7 +1,7 @@
module.exports = {
tables: [
{
TableName: `DynamoDB`,
TableName: process.env.DB_TABLE,
KeySchema: [
{ AttributeName: "PK", KeyType: "HASH" },
{ AttributeName: "SK", KeyType: "RANGE" }
Expand Down
Expand Up @@ -24,7 +24,7 @@ class TenancyTestEnvironment extends NodeEnvironment {
return {
storageOperations: createStorageOperations({
documentClient,
table: table => ({ ...table, name: "DynamoDB" })
table: table => ({ ...table, name: process.env.DB_TABLE })
}),
plugins: []
};
Expand Down
2 changes: 1 addition & 1 deletion packages/api-tenancy-so-ddb/jest-dynalite-config.js
@@ -1,7 +1,7 @@
module.exports = {
tables: [
{
TableName: `DynamoDB`,
TableName: process.env.DB_TABLE,
KeySchema: [
{ AttributeName: "PK", KeyType: "HASH" },
{ AttributeName: "SK", KeyType: "RANGE" }
Expand Down

0 comments on commit 83d6ff5

Please sign in to comment.