Skip to content

Commit c82a3d9

Browse files
committed
Add tests for activestorage and postgres-client features
1 parent 4aea1b2 commit c82a3d9

File tree

9 files changed

+101
-0
lines changed

9 files changed

+101
-0
lines changed

.github/workflows/test-features.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
- bun
1717
- mysql-client
1818
- sqlite3
19+
- activestorage
20+
- postgres-client
1921
baseImage:
2022
- debian:latest
2123
- ubuntu:latest
@@ -29,3 +31,21 @@ jobs:
2931
- name: "Generating tests for '${{ matrix.features }}' against '${{ matrix.baseImage }}'"
3032
working-directory: features
3133
run: devcontainer features test --skip-scenarios -f ${{ matrix.features }} -i ${{ matrix.baseImage }} .
34+
35+
test-scenarios:
36+
runs-on: ubuntu-latest
37+
continue-on-error: true
38+
strategy:
39+
matrix:
40+
features:
41+
- activestorage
42+
- postgres-client
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- name: "Install latest devcontainer CLI"
47+
run: npm install -g @devcontainers/cli
48+
49+
- name: "Generating tests for '${{ matrix.features }}' scenarios"
50+
working-directory: features
51+
run: devcontainer features test -f ${{ matrix.features }} --skip-autogenerated --skip-duplicated .

features/src/postgres-client/install.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ export POSTGRES_CLIENT_VERSION="${VERSION:-"15"}"
55

66
apt-get update -qq
77

8+
apt-get install -y gnupg ca-certificates
9+
810
VERSION_EXISTS=$(apt-cache search --names-only postgresql-client-$POSTGRES_CLIENT_VERSION | wc -l)
911

1012
if [ "$VERSION_EXISTS" -ge 1 ]; then
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
set -e
3+
4+
source dev-container-features-test-lib
5+
6+
check "imagemagick is installed" bash -c "convert --version"
7+
check "FFmpeg is installed" bash -c "ffmpeg -version"
8+
check "Poppler is installed" bash -c "pdftoppm -v"
9+
10+
reportResults
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"image_processor_imagemagick": {
3+
"image": "mcr.microsoft.com/devcontainers/base:1-bookworm",
4+
"features": {
5+
"activestorage": {
6+
"variantProcessor": "mini_magick"
7+
}
8+
}
9+
}
10+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
set -e
3+
4+
source dev-container-features-test-lib
5+
6+
check "libvips is installed" bash -c "dpkg -l | grep libvips"
7+
8+
check "FFmpeg is installed" bash -c "ffmpeg -version"
9+
check "Poppler is installed" bash -c "pdftoppm -v"
10+
11+
reportResults
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"version_16": {
3+
"image": "mcr.microsoft.com/devcontainers/base:1-bookworm",
4+
"features": {
5+
"postgres-client": {
6+
"version": "16"
7+
}
8+
}
9+
},
10+
"version_14": {
11+
"image": "mcr.microsoft.com/devcontainers/base:1-bookworm",
12+
"features": {
13+
"postgres-client": {
14+
"version": "14"
15+
}
16+
}
17+
}
18+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
set -e
3+
4+
source dev-container-features-test-lib
5+
6+
check "PostgreSQL client is installed" bash -c "psql --version"
7+
check "PostgreSQL version is 15" bash -c "psql --version | grep -q 'psql (PostgreSQL) 15'"
8+
check "libpq-dev is installed" bash -c "dpkg -l | grep libpq-dev"
9+
10+
reportResults
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
set -e
3+
4+
source dev-container-features-test-lib
5+
6+
check "PostgreSQL client is installed" bash -c "psql --version"
7+
check "PostgreSQL version is 14" bash -c "psql --version | grep -q 'psql (PostgreSQL) 14'"
8+
check "libpq-dev is installed" bash -c "dpkg -l | grep libpq-dev"
9+
10+
reportResults
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
set -e
3+
4+
source dev-container-features-test-lib
5+
6+
check "PostgreSQL client is installed" bash -c "psql --version"
7+
check "PostgreSQL version is 16" bash -c "psql --version | grep -q 'psql (PostgreSQL) 16'"
8+
check "libpq-dev is installed" bash -c "dpkg -l | grep libpq-dev"
9+
10+
reportResults

0 commit comments

Comments
 (0)