Add integration tests for Magma queries