Skip to content

Commit 3fa2cc3

Browse files
committed
Merge branch 'main' into 3-elasticsearch
2 parents 7fc5bbd + 26740bd commit 3fa2cc3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1755
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: PostgreSQL Tests
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
leia-tests:
8+
runs-on: ${{ matrix.os }}
9+
env:
10+
TERM: xterm
11+
strategy:
12+
matrix:
13+
leia-tests:
14+
- examples/postgresql-9.3
15+
- examples/postgresql-9.6
16+
- examples/postgresql-10
17+
- examples/postgresql-11
18+
- examples/postgresql-12
19+
- examples/postgresql-13
20+
lando-versions:
21+
- edge
22+
os:
23+
- ubuntu-20.04
24+
node-version:
25+
- '14'
26+
27+
steps:
28+
# Install deps and cache
29+
- name: Checkout code
30+
uses: actions/checkout@v2
31+
- name: Install node ${{ matrix.node-version }}
32+
uses: actions/setup-node@v2
33+
with:
34+
node-version: ${{ matrix.node-version }}
35+
cache: yarn
36+
- name: Install Yarn dependencies
37+
run: yarn install --prefer-offline --frozen-lockfile
38+
39+
# This block should eventually become use lando/actions-hyperdrive@v2
40+
- name: Verify Docker dependencies
41+
run: |
42+
docker --version | grep "20.10."
43+
docker-compose --version | grep "1.29."
44+
- name: Grab latest edge Lando CLI
45+
run: |
46+
sudo curl -fsSL -o /usr/local/bin/lando "https://files.lando.dev/cli/lando-linux-x64-${{ matrix.lando-versions }}"
47+
sudo chmod +x /usr/local/bin/lando
48+
- name: Move in lando config appropriate for testing
49+
run: |
50+
mkdir -p ~/.lando/cache
51+
cp -f actions-lando-config.yml ~/.lando/config.yml
52+
echo false > ~/.lando/cache/report_errors
53+
lando --clear
54+
- name: Verify Lando works and we are dogfooding this plugin for tests
55+
run: |
56+
lando version
57+
lando config --path plugins | grep platformsh | grep /home/runner/work/platformsh/platformsh || echo "::error:: Not dogfooding this plugin correctly! "
58+
cd ${{ matrix.leia-tests }}
59+
lando config --path plugins | grep platformsh | grep dir | grep /home/runner/work/platformsh/platformsh || echo "::error:: Not dogfooding this plugin correctly! "
60+
61+
# This block should eventually become use lando/actions-leia@v2
62+
# @NOTE? Do we want a way for our leia-action to configure apparmor since
63+
# this might break a whole bunch of tests? or is this literally just a thing
64+
# for the platform.sh mysql/mariadb container?
65+
- name: Configure apparmor
66+
run: |
67+
set -x
68+
sudo apt-get remove mysql-server --purge
69+
sudo apt-get install apparmor-profiles
70+
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
71+
- name: Run leia tests
72+
shell: bash
73+
run: yarn leia "./${{ matrix.leia-tests }}/README.md" -c 'Destroy tests' --stdin --shell bash
74+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Drupal editor configuration normalization
2+
# @see http://editorconfig.org/
3+
4+
# This is the top-most .editorconfig file; do not search in parent directories.
5+
root = true
6+
7+
# All files.
8+
[*]
9+
end_of_line = LF
10+
indent_style = space
11+
indent_size = 4
12+
charset = utf-8
13+
trim_trailing_whitespace = true
14+
insert_final_newline = true
15+
16+
[composer.{json,lock}]
17+
indent_size = 4
18+
19+
[.platform.app.yaml]
20+
indent_size = 4

examples/postgresql-10/.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
vendor
2+
files
3+
data
4+
private
5+
.platform/local
6+
7+
*.sql
8+
*.tar.gz
9+
*.tar
10+
11+
.DS_Store

examples/postgresql-10/.lando.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: lando-platformsh-postgresql-10
2+
recipe: platformsh
3+
config:
4+
id: DISCONNECTED
5+
6+
7+
# This is important because it lets lando know to test against the plugin in this repo
8+
# DO NOT REMOVE THIS!
9+
plugins:
10+
"@lando/platformsh": ./../../
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: app
2+
type: "php:7.3"
3+
disk: 1024
4+
build:
5+
flavor: composer
6+
web:
7+
locations:
8+
"/":
9+
root: "."
10+
passthru: "/index.php"
11+
relationships:
12+
postgresql: "postgresql:postgresql"
13+
runtime:
14+
extensions:
15+
- pdo_pgsql
16+
mounts:
17+
'files':
18+
source: local
19+
source_path: files
20+
'private':
21+
source: local
22+
source_path: private
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# The routes of the project.
2+
#
3+
# Each route describes how an incoming URL is going
4+
# to be processed by Platform.sh.
5+
6+
"https://{default}/":
7+
type: upstream
8+
upstream: "app:http"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
postgresql:
2+
type: postgresql:10
3+
disk: 512

examples/postgresql-10/README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
Platform.sh PostgreSQL 10 Example
2+
================================
3+
4+
This example exists to test this plugin's implementation of Platform.sh's `postgresql:10` service.
5+
6+
* [Platform.sh PostgreSQL 10](https://docs.platform.sh/configuration/services/postgresql.html)
7+
8+
Start up tests
9+
--------------
10+
11+
Run the following commands to get up and running with this example.
12+
13+
```bash
14+
# Should poweroff
15+
lando poweroff
16+
17+
# Should start up successfully
18+
lando start
19+
```
20+
21+
Verification commands
22+
---------------------
23+
24+
Run the following commands to validate things are rolling as they should.
25+
26+
```bash
27+
# Should have the expected platformsh containers and images
28+
docker ps --filter label=com.docker.compose.project=landoplatformshpostgresql10 | grep docker.registry.platform.sh/php-7.3 | grep landoplatformshpostgresql10_app_1
29+
docker ps --filter label=com.docker.compose.project=landoplatformshpostgresql10 | grep docker.registry.platform.sh/postgresql-10 | grep landoplatformshpostgresql10_postgresql_1
30+
31+
# Should be running all application containers as web
32+
lando ssh -s app -c "id" | grep web
33+
34+
# Should have the platform cli in all application containers
35+
lando ssh -s app -c "platform -V"
36+
37+
# Should be running the correct php version
38+
lando ssh -s app -c "php --version" | grep 7.3.
39+
40+
# Should be running all postgresql containers as postgres
41+
lando ssh -s postgresql -c "id" | grep postgres
42+
43+
# Should be running the correct postgresql versions
44+
lando ssh -s postgresql -c "psql -V" | grep 10.
45+
46+
# Should be able to connect to all postgresql relationships
47+
lando postgresql main -c "\dt"
48+
49+
# Should be able to connect to postgresql from the application containers
50+
lando ssh -s app -c "curl -I localhost/postgresql.php" | grep HTTP/1.1 | grep "200 OK"
51+
```
52+
53+
Destroy tests
54+
-------------
55+
56+
Run the following commands to trash this app like nothing ever happened.
57+
58+
```bash
59+
# Should be able to destroy our app
60+
lando destroy -y
61+
62+
# Should poweroff
63+
lando poweroff
64+
```
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "lando/platformsh-postgresql",
3+
"description": "A basic application to test Lando's implementation of platformsh's postgresql service.",
4+
"license": "MIT",
5+
"type" : "project",
6+
"require": {
7+
"php": ">7.2",
8+
"platformsh/config-reader": "~2.0"
9+
},
10+
"autoload": {
11+
"psr-4": {
12+
"App\\": "src/"
13+
}
14+
}
15+
}

examples/postgresql-10/composer.lock

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)