I was happy to see that it is now possible to automatically load extensions, without building a custom k6 binary. I have a case where I need to test a postgres database, so let’s use it!
INFO[0000] Automatic extension resolution is enabled. The current k6 binary doesn’t satisfy all dependencies, it’s required to provision a custom binary. deps=“k6;k6/x/sql;k6/x/sql/driver/postgres”
ERRO[0000] Failed to provision a k6 binary with required dependencies. Please, make sure to report this issue by opening a bug report. error="building binary: request failed: Post “https:// ingest. k6. io/builder/api/v1/build": dial tcp: lookup ingest.k6.io: no such host”
ERRO[0000] building binary: request failed: Post “https:// ingest. k6. io/builder/api/v1/build”: dial tcp: lookup ingest.k6.io: no such host
this makes sense, as the network where I’m at does block a lot.
So I want to load these extensions automatically from a local source, something like replacing:
import sql from 'k6/x/sql';
import driver from 'k6/x/sql/driver/postgres';
by:
import sql from 'local/path/sql';
import driver from 'local/path/postgres';
But where do I download these from?
On github xk6-sql seems to provide binaries, but xk6-sql-driver-postgres doesn’t. And the k6 binary itself tries from ingestor anyway.