Skip to content

How to set up test

Arya Permana edited this page Jun 27, 2024 · 14 revisions

Tutorial set up test for aiku πŸ§ͺ

Cloning The repository πŸ“‘

https://github.com/inikoo/aiku.git

Installing PHP 8.3

  • sudo apt upgrade
  • sudo apt install software-properties-common
  • sudo add-apt-repository ppa:ondrej/php
  • sudo apt update
  • sudo apt install php8.2
  • php -v
  • sudo apt install php-mysql redis-server php-curl php-mbstring php-xml php-pgsql php-soap php-gd php-intl php-zip php-redis

Installing Composer 🎢

  • sudo apt install php-cli unzip
  • cd ~
  • curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
  • HASH=curl -sS https://composer.github.io/installer.sig
  • php -r "if (hash_file('SHA384', '/tmp/composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
  • sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer

Installing Postgresql πŸͺ£

  • sudo apt update
  • sudo apt install postgresql postgresql-contrib
  • sudo service postgresql start

Start the postgresql ⭐

sudo service postgresql start

Installing Elasticsearch πŸ”

  • curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
  • echo "deb https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-8.x.list
  • sudo apt update
  • sudo apt install elasticsearch

Update elasticsearch.yml πŸ“‘

sudo nano /etc/elasticsearch/elasticsearch.yml

Change network host to localhost πŸ“‘

find network.host: and set the value to localhost

Change SECURITY AUTO CONFIGURATION πŸ“‘

Set everything that has a true value into false

Start ElasticSearch ⭐

sudo service elasticsearch start

To check if the Elasticsearch works properly πŸ”

curl -XGET http://127.0.0.1:9200

Setting Up database πŸͺ£

To Enter Postgresql πŸšͺ

  • type su postgres and enter
  • type psql and enter

Queries πŸ“‘

  • CREATE USER user_name WITH PASSWORD 'password';
  • create database aiku;
  • ALTER DATABASE aiku OWNER TO user_name;
  • \c aiku
  • CREATE SCHEMA central;
  • ALTER SCHEMA central OWNER TO user_name;
  • create database aiku_test;
  • ALTER DATABASE aiku_test OWNER TO user_name;
  • \c aiku_test
  • CREATE SCHEMA central;
  • ALTER SCHEMA central OWNER TO user_name;

To Alter USER to SUPERUSER πŸ“‘

ALTER USER user_name WITH SUPERUSER

To exit postgresql

type \q and enter

Creating .pgpass πŸ“‘

  • nano .pgpass
  • *:*:*:*:password <= type inside .pgpass
  • chmod 0600 ~/.pgpass

Setting Up Aiku ❀️

  • cd aiku
  • composer install
  • sudo apt install npm
  • npm install

Additional Requirements πŸ€·β€β™‚οΈ

all these requirements are needed to be able to run the test, please kindly ask us for these files 😊

  • .env
  • .env.testing
  • private folder

Running The Test πŸ§ͺ

  • cd aiku
  • npm run build
  • ./generate_testing_db_dumps.sh
  • vendor/bin/pest --exclude-group=aurora-fetch