Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration test for secret ops #1408

Merged
merged 20 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f09c48d
feat(e2e): fixed seed file issue and added more seeding
akhilmhdh Feb 15, 2024
00876f7
feat(e2e): added secrets integration tests
akhilmhdh Feb 15, 2024
90f09c7
feat(e2e): added service token integration tests
akhilmhdh Feb 15, 2024
4c49119
feat(e2e): added identity token secret access integration tests
akhilmhdh Feb 15, 2024
b24d748
feat(e2e): added gh action for execution of integration tests on PR a…
akhilmhdh Feb 15, 2024
793440f
feat(e2e): made rebased changes
akhilmhdh Feb 15, 2024
c71af00
feat(e2e): added enc key on gh action for be test file
akhilmhdh Feb 15, 2024
4f3cf04
feat(e2e): fixed post clean up error on gh be integration action
akhilmhdh Feb 15, 2024
b84579b
feat(e2e): changed to root .env.test and added .env.test.example
akhilmhdh Feb 15, 2024
c6c64b5
trigger workflow
maidul98 Feb 17, 2024
abd28d9
remove comment
maidul98 Feb 17, 2024
8864c81
feat: updated to reuse and run integration api test before release
akhilmhdh Feb 18, 2024
678306b
feat: some name changes for better understanding on testing
akhilmhdh Feb 18, 2024
7070a69
feat: made e2ee api test indepdent or stateless
akhilmhdh Feb 19, 2024
35d589a
add more secret test cases
maidul98 Feb 19, 2024
e4b8937
add env slug to make expect more strict
maidul98 Feb 19, 2024
d428fd0
update test envs
maidul98 Feb 19, 2024
2996efe
feat: made secrets ops test to have both identity and jwt token based…
akhilmhdh Feb 20, 2024
b4db06c
return empty string for decrypt fuction
maidul98 Feb 20, 2024
ccaa9fd
add more test cases
maidul98 Feb 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .env.test.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
DB_CONNECTION_URI=postgres://infisical:infisical@localhost:5430/infisical-test
akhilmhdh marked this conversation as resolved.
Show resolved Hide resolved
REDIS_URL=redis://redis:6379
# Keys
# Required key for platform encryption/decryption ops
# THIS IS A SAMPLE ENCRYPTION KEY AND SHOULD NOT BE USED FOR PRODUCTION
ENCRYPTION_KEY=6c1fe4e407b8911c104518103505b218
AUTH_SECRET=something-random
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@ on:
- "infisical/v*.*.*-postgres"

jobs:
infisical-tests:
name: Run tests before deployment
runs-on: ubuntu-latest
steps:
- name: Run backend api integration tests
# https://docs.github.com/en/actions/using-workflows/reusing-workflows#overview
uses: ./.github/workflows/run-backend-tests.yml
maidul98 marked this conversation as resolved.
Show resolved Hide resolved
infisical-standalone:
name: Build infisical standalone image postgres
runs-on: ubuntu-latest
needs: [infisical-tests]
steps:
- name: Extract version from tag
id: extract_version
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/run-backend-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Run backend tests"

on:
pull_request:
types: [opened, synchronize]
paths:
- "backend/**"
- "!backend/README.md"
- "!backend/.*"
- "backend/.eslintrc.js"
workflow_call:

jobs:
check-be-pr:
name: Run integration test
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: ☁️ Checkout source
uses: actions/checkout@v3
- uses: KengoTODA/actions-setup-docker-compose@v1
if: ${{ env.ACT }}
maidul98 marked this conversation as resolved.
Show resolved Hide resolved
name: Install `docker-compose` for local simulations
with:
version: "2.14.2"
- name: 🔧 Setup Node 20
uses: actions/setup-node@v3
with:
node-version: "20"
cache: "npm"
cache-dependency-path: backend/package-lock.json
- name: Install dependencies
run: npm install
working-directory: backend
- name: Start postgres and redis
run: touch .env && docker-compose -f docker-compose.dev.yml up -d db redis
maidul98 marked this conversation as resolved.
Show resolved Hide resolved
- name: Start integration test
run: npm run test:e2e
working-directory: backend
env:
REDIS_URL: redis://172.17.0.1:6379
DB_CONNECTION_URI: postgres://infisical:[email protected]:5432/infisical?sslmode=disable
AUTH_SECRET: something-random
ENCRYPTION_KEY: 4bnfe4e407b8921c104518903515b218
- name: cleanup
run: |
docker-compose -f "docker-compose.dev.yml" down
akhilmhdh marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions backend/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
vitest-environment-infisical.ts
vitest.config.ts
vitest.e2e.config.ts
12 changes: 12 additions & 0 deletions backend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ module.exports = {
tsconfigRootDir: __dirname
},
root: true,
overrides: [
{
files: ["./e2e-test/**/*"],
rules: {
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-call": "off",
}
}
],
rules: {
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-unsafe-enum-comparison": "off",
Expand Down
Loading
Loading