- Docker
- Docker Compose
- Go 1.23.2 (or higher)
- You have followed the instructions to set up the .env file in the main README
Open a terminal in the integration-tests/lca_cost
directory.
Install dependencies:
go mod tidy
- Create a new directory called
assets
in theintegration-tests
directory. - Add an IFC file to the
assets
directory. - Rename the file to
test.ifc
.
Use the 'mssql' extension in VSCode to start the Azure SQL Server Emulator. Follow the instructions in this video closely: https://www.youtube.com/watch?v=3XgepwpBJP8
Basic steps: Go to the Database Projects section of the 'mssql' extension in VSCode. Right click on the project and select 'Build'. >> follow the video tutorial Right click on the project and select 'Publish'. >> follow the video tutorial
Switch to the 'SQL Server' tab in VSCode. Connect to the Azure SQL Server Emulator. Skip all optionals inputs, use 'sa' as the username and provide a password.
Open the project_data.sql file. In the bottom right corner of VSCode where it says 'Disconnect', click on it and connect to the emulator. make sure to select the 'sa' user and later the right 'database' or whatever it is called. Choose (nhmzh-viz-services-localdev) as the database. Run 'project_data.sql' to create the database table.
Open a new terminal window in the integration-tests
directory:
cd integration-tests
Run the following command to start the services:
docker compose up --build -d
You should now have one container running for the Azure SQL Server Emulator and a contaier group (or however that is called) running for all the integration tests services.
In your browser, go to localhost:9001
to see the MinIO console.
- Login using the credentials you specified in the .env ( main README )
- Delete all items in the
ifc-files
bucket. - Delete the
ifc-files
bucket. - Delete all items in the
ifc-fragment-files
bucket. - Delete the
ifc-fragment-files
bucket. - Delete all items in the
lca-cost-data
bucket. - Delete the
lca-cost-data
bucket.
Open a terminal in the integration-tests/ifc
directory and run:
go run main.go
Watch the output of the terminal. It should tell you that the test was passed. This takes up to a minute.
Verify the content was added correctly:
Verify that the bucket was created and that the content was added correctly:
- Refresh the Object Browser in the MinIO console.
- You should see new buckets called
ifc-files
andifc-fragment-files
. - Open the buckets. If no folders show up, try refreshing the bucket.
- Open the folders and check that the files are present.
Check the output of the test.ts in the terminal. It should say: "Pass: Fragments file is a Buffer".
Open a terminal in the integration-tests/lca_cost
directory and run:
go run main.go
Verify the content was added correctly:
In the (VS Code) environment where you set up the Azure SQL Server Emulator, go to the SQL Server Explorer.