Advice usage - NextensArelB/SwaggerGenerationTool GitHub Wiki

DataMigration tool

To see general documentation see tool wiki page.

Intro

The DataMigration tool is used to migrate aangifte dossiers from one environment to another.

Reason

To run Advice api test on another environment a lot of aangifte data across multiple aangiftes is needed. Migrating this by hand is quite time consuming. When migrating this data by hand to different environments you also need to retrieve a lot of newly created ids (aangifteId, partnerId, ondernemingId etc..) and change/add them in your testing script. This is what we want to improve and automate.

Solution

Abstract usage of Ids (aangifteId, partnerId, ondernamingId etc) in scripts. This will enable us to substitute ids after migration and not change test scripts.

High level approach

Ids would be read from json and use embedded expressions to substitute in place were they are used (see picture below). Advice Test GenericTool (1).jpg

To run test on a different env, we will need to migrate aangiftes and generate a json file. No changes to test scripts.

Note: swiching generated json from tool will be done as follows: "...pathTo/generatedFile/fromTool/"+ _env_+ ".json"

Run DataMigrationTool locally

Location in Advice API testing project

The DataMigration tool is located in folder .dataMigrationTool

image.png

Running tool

To run the DataMigrationTool you can use VSC powershell terminal and run export or import command.

Or running the PowerShell script located in the root of the project:

image.png

RunDownloadAangiftes.ps1 and RunImportAangiftes.ps1 are generic PowerShell scripts and can be used to create other scripts or to run them directly with valid arguments. Other PowerShell scripts are set up for a specific environment.

Running steps

Export process

  • Open Advice project in VSC
  • Open terminal
  • In terminal type .\RunDownloadAangiftes_DLV.ps1 and hit enter. image.png

This should initiate the tool to start the export process. *Currently downloaded aangiftes are saved to the ./SeedAangiftes folder, but this can be changed in the script.

Import process

  • Open Advice project in VSC
  • Open terminal
  • In terminal type .\RunImportAangiftes_Dev03.ps1 and hit enter.

image.png

This should initiate the tool to start the import process. *Generated json with newly created ids are located in ./src/TestCaseData/ image.png

⚠️ **GitHub.com Fallback** ⚠️