Skip to content

Commit

Permalink
#38: revert
Browse files Browse the repository at this point in the history
  • Loading branch information
phjulia committed Jul 11, 2023
1 parent 97d4355 commit 3e09830
Show file tree
Hide file tree
Showing 21 changed files with 69 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"r__type": "importFile"
},
{
"name": "testExisting_query1",
"name": "testExisting_query",
"r__type": "query"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"r__type": "importFile"
},
{
"name": "testExisting_query1",
"name": "testExisting_query",
"r__type": "query"
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "testExisting_query1",
"name": "testExisting_query",
"key": "testExisting_query",
"description": "updated on deploy",
"targetKey": "testExisting_dataExtension",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "testExisting_query1",
"key": "testExisting_query",
"description": "updated on deploy",
"name": "updateMePlease",
"key": "testNew_query1",
"description": "created on deploy",
"targetKey": "testExisting_dataExtension",
"createdDate": "2022-04-26T15:21:16.453",
"modifiedDate": "2022-04-26T16:04:15.88",
Expand Down
2 changes: 1 addition & 1 deletion test/resources/9999999/automation/build-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"r__type": "importFile"
},
{
"name": "testTemplated_query1",
"name": "testTemplated_query",
"r__type": "query"
},
{
Expand Down
2 changes: 1 addition & 1 deletion test/resources/9999999/automation/create-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"r__type": "importFile"
},
{
"name": "testExisting_query1",
"name": "testExisting_query",
"r__type": "query"
},
{
Expand Down
2 changes: 1 addition & 1 deletion test/resources/9999999/automation/retrieve-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"r__type": "importFile"
},
{
"name": "testExisting_query1",
"name": "testExisting_query",
"r__type": "query"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@

**Schedule:**

- Start: 2022-07-30 00:00:00 +01:00
- End: 2022-07-30 00:00:00 +01:00
- Timezone: W. Europe Standard Time
- Recurrance: every day for 1 times
* Start: 2022-07-30 00:00:00 +01:00
* End: 2022-07-30 00:00:00 +01:00
* Timezone: W. Europe Standard Time
* Recurrance: every day for 1 times

**Notifications:**

- Complete: [email protected]
- Error: [email protected] ("test")
* Complete: [email protected]
* Error: [email protected] ("test")

| Step 1<br>_<small>-</small>_ |
| ------------------------------------------------ |
| _1.1: dataExtract_<br>testExisting_dataExtract |
| _1.2: emailSend_<br>testExisting_emailSend |
| Step 1<br>_<small>-</small>_ |
| --- |
| _1.1: dataExtract_<br>testExisting_dataExtract |
| _1.2: emailSend_<br>testExisting_emailSend |
| _1.3: fileTransfer_<br>testExisting_fileTransfer |
| _1.4: importFile_<br>testExisting_importFile |
| _1.5: query_<br>testExisting_query1 |
| _1.6: script_<br>testExisting_script |
| _1.4: importFile_<br>testExisting_importFile |
| _1.5: query_<br>testExisting_query |
| _1.6: script_<br>testExisting_script |
2 changes: 1 addition & 1 deletion test/resources/9999999/automation/template-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"r__type": "importFile"
},
{
"name": "{{{prefix}}}query1",
"name": "{{{prefix}}}query",
"r__type": "query"
},
{
Expand Down
2 changes: 1 addition & 1 deletion test/resources/9999999/automation/update-expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"r__type": "importFile"
},
{
"name": "testExisting_query1",
"name": "testExisting_query",
"r__type": "query"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@

**Schedule:**

- Start: 2022-07-30 00:00:00 +01:00
- End: 2022-07-30 00:00:00 +01:00
- Timezone: W. Europe Standard Time
- Recurrance: every day for 1 times
* Start: 2022-07-30 00:00:00 +01:00
* End: 2022-07-30 00:00:00 +01:00
* Timezone: W. Europe Standard Time
* Recurrance: every day for 1 times

**Notifications:** _none_

| Step 1<br>_<small>-</small>_ |
| ------------------------------------------------ |
| _1.1: dataExtract_<br>testExisting_dataExtract |
| _1.2: emailSend_<br>testExisting_emailSend |

| Step 1<br>_<small>-</small>_ |
| --- |
| _1.1: dataExtract_<br>testExisting_dataExtract |
| _1.2: emailSend_<br>testExisting_emailSend |
| _1.3: fileTransfer_<br>testExisting_fileTransfer |
| _1.4: importFile_<br>testExisting_importFile |
| _1.5: query_<br>testExisting_query1 |
| _1.6: script_<br>testExisting_script |
| _1.4: importFile_<br>testExisting_importFile |
| _1.5: query_<br>testExisting_query |
| _1.6: script_<br>testExisting_script |
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"queryDefinitionId": "549f0568-607c-4940-afef-437965094dat",
"name": "testExisting_query1",
"name": "testExisting_query",
"key": "testExisting_query",
"description": "bla bla",
"queryText": "SELECT\n SubscriberKey as testField\nFROM\n _Subscribers\nWHERE\n country IN ('test')\n",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"queryDefinitionId": "549f0568-607c-4940-afef-437965094dat",
"name": "testExisting_query1",
"name": "testExisting_query",
"key": "testExisting_query",
"description": "updated on deploy",
"queryText": "SELECT\n SubscriberKey as testField\nFROM\n _Subscribers\nWHERE\n country IN ('test')\n",
Expand Down
19 changes: 18 additions & 1 deletion test/resources/9999999/automation/v1/queries/get-response.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"items": [
{
"queryDefinitionId": "549f0568-607c-4940-afef-437965094dat",
"name": "testExisting_query1",
"name": "testExisting_query",
"key": "testExisting_query",
"description": "bla bla",
"queryText": "SELECT\n SubscriberKey as testField\nFROM\n _Subscribers\nWHERE\n country IN ('test')\n",
Expand Down Expand Up @@ -36,6 +36,23 @@
"targetUpdateTypeName": "Overwrite",
"categoryId": 999,
"isFrozen": false
},
{
"queryDefinitionId": "b28a1c2f-6656-478a-be51-4f12be4c9088",
"name": "updateMePlease",
"key": "testNew_query1",
"description": "bla bla",
"queryText": "SELECT\n SubscriberKey as testField\nFROM\n _Subscribers\nWHERE\n country IN ('test')\n",
"targetName": "testExisting_dataExtension",
"targetKey": "testExisting_dataExtension-WRONG",
"targetId": "21711373-72c1-ec11-b83b-48df37d1deb7",
"targetDescription": "",
"createdDate": "2022-04-26T15:21:16.453",
"modifiedDate": "2022-04-26T16:02:44.01",
"targetUpdateTypeId": 0,
"targetUpdateTypeName": "Overwrite",
"categoryId": 999,
"isFrozen": false
}
]
}
2 changes: 1 addition & 1 deletion test/resources/9999999/query/build-expected.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "testTemplated_query1",
"name": "testTemplated_query",
"key": "testTemplated_query",
"description": "foobar",
"targetKey": "testTemplated_dataExtension",
Expand Down
2 changes: 1 addition & 1 deletion test/resources/9999999/query/get-expected.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "testExisting_query1",
"name": "testExisting_query",
"key": "testExisting_query",
"description": "bla bla",
"targetKey": "testExisting_dataExtension",
Expand Down
2 changes: 1 addition & 1 deletion test/resources/9999999/query/patch-expected.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "testExisting_query1",
"name": "testExisting_query",
"key": "testExisting_query",
"description": "updated on deploy",
"targetKey": "testExisting_dataExtension",
Expand Down
6 changes: 0 additions & 6 deletions test/resources/9999999/query/patch1-expected.sql

This file was deleted.

2 changes: 1 addition & 1 deletion test/resources/9999999/query/template-expected.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "{{{prefix}}}query1",
"name": "{{{prefix}}}query",
"key": "{{{prefix}}}query",
"description": "{{{description}}}",
"targetKey": "{{{prefix}}}dataExtension",
Expand Down
12 changes: 9 additions & 3 deletions test/type.query.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('type: query', () => {
const result = cache.getCache();
assert.equal(
result.query ? Object.keys(result.query).length : 0,
2,
3,
'only two queries expected'
);
// normal test
Expand Down Expand Up @@ -142,14 +142,18 @@ describe('type: query', () => {
});
it('Should create & upsert a query', async () => {
// WHEN
await handler.deploy('testInstance/testBU', ['query']);
await handler.deploy(
'testInstance/testBU',
['query'],
['testNew_query', 'testExisting_query']
);
// THEN
assert.equal(process.exitCode, false, 'deploy should not have thrown an error');
// get results from cache
const result = cache.getCache();
assert.equal(
result.query ? Object.keys(result.query).length : 0,
3,
4,
'three queries expected'
);
// confirm created item
Expand Down Expand Up @@ -183,6 +187,7 @@ describe('type: query', () => {
handler.setOptions({ execute: true });
// WHEN
await handler.deploy('testInstance/testBU', ['query']);
await handler.deploy('testInstance/testBU', ['query']);
// THEN
assert.equal(
process.exitCode,
Expand Down Expand Up @@ -214,6 +219,7 @@ describe('type: query', () => {
'testInstance/testBU',
'query',
['testExisting_query'],
['testExisting_query'],
'testSourceMarket'
);
// WHEN
Expand Down

0 comments on commit 3e09830

Please sign in to comment.