Skip to content

Commit f050f1d

Browse files
committed
ci: switch to rust integration tests
1 parent 1f87235 commit f050f1d

19 files changed

+226
-287
lines changed

.github/workflows/build.yml

+11-36
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,18 @@ jobs:
1818
build:
1919
name: 'Rust Build'
2020
runs-on: ubuntu-latest
21+
services:
22+
vault:
23+
image: hashicorp/vault:1.17.1
24+
ports:
25+
- 8200:8200
26+
options: --cap-add=IPC_LOCK
27+
env:
28+
VAULT_DEV_ROOT_TOKEN_ID: 'root-token'
2129
steps:
2230
- name: Check out code
2331
uses: actions/checkout@v4
24-
- name: Install stable toolchain
32+
- name: Install stable Toolchain
2533
uses: actions-rs/toolchain@v1
2634
with:
2735
profile: ${{ env.TOOLCHAIN_PROFILE }}
@@ -40,10 +48,11 @@ jobs:
4048
with:
4149
command: clippy
4250
# args: -- -D warnings
43-
- name: Unit- and Integration-Tests
51+
- name: Unit and Integration Tests
4452
uses: actions-rs/cargo@v1
4553
env:
4654
RUST_TEST_THREADS: 1
55+
VAULT_TOKEN: 'root-token'
4756
with:
4857
command: test
4958
- name: Build Binary
@@ -56,40 +65,6 @@ jobs:
5665
with:
5766
name: cli
5867
path: target/release/propeller
59-
test:
60-
name: 'Integration Test CLI'
61-
needs: build
62-
runs-on: ubuntu-latest
63-
services:
64-
vault:
65-
image: hashicorp/vault:1.17.1
66-
ports:
67-
- 8200:8200
68-
options: --cap-add=IPC_LOCK
69-
env:
70-
VAULT_DEV_ROOT_TOKEN_ID: 'root-token'
71-
steps:
72-
- name: Check out code
73-
uses: actions/checkout@v4
74-
with:
75-
name: cli
76-
- name: Setup Node.js
77-
uses: actions/setup-node@v4
78-
with:
79-
node-version: 20.15.0
80-
cache: 'npm'
81-
- name: Install node.js packages
82-
run: npm ci
83-
- name: Wait for Vault
84-
run: npm run ci:wait-for-vault
85-
- name: Download Binary
86-
uses: actions/download-artifact@v4
87-
- name: Run integration tests
88-
run: |
89-
chmod 755 ./cli/propeller
90-
./cli/propeller init-vault -c dev/config.yml
91-
env:
92-
VAULT_TOKEN: 'root-token'
9368
check:
9469
name: 'Resources Validation'
9570
runs-on: ubuntu-latest

.idea/runConfigurations/Test_propeller.xml .idea/runConfigurations/Build_propeller.xml

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Integration_Test_propeller.xml

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Unit_Test_propeller.xml

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Run_propeller__rotate.xml .idea/runConfigurations/propeller__init_vault.xml

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Run_propeller__init_vault.xml .idea/runConfigurations/propeller__rotate.xml

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+6
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ serde_yaml = "0.9.34+deprecated"
1313
tokio = { version = "1.38.0", features = ["macros", "rt"] }
1414
vaultrs = "0.7.2"
1515
rand = "0.9.0-alpha.1"
16+
17+
[dev-dependencies]
18+
assert_cmd = "2.0.14"
19+
predicates = "3.1.0"
20+
reqwest = { version = "0.12.5", features = ["json"] }
21+
serde_json = "1.0.120"

DEVELOPMENT.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ Before you start, ensure you have the following installed:
88

99
- [Git](https://git-scm.com/downloads): For version control
1010
- Git LFS: For managing large files within the project
11-
- [Node.js](https://nodejs.org/en/download: For running certain project scripts (including dependency management)
11+
- [Node.js](https://nodejs.org/en/download): For running certain project scripts (including dependency management)
1212
- [`podman`](https://podman.io/docs/installation) or [Docker](https://www.docker.com/products/docker-desktop/): For containerization of the Vault instance and databases
13+
- This is especially required for [integration testing](#running-tests)
1314

14-
## Cloning the Repository
15+
## Preparing the Repository
1516

1617
1. Clone the `propeller` project from GitHub:
1718

@@ -52,7 +53,7 @@ npm ci --cache .npm
5253
- **A Vault instance:** For managing secrets
5354

5455
Note that if using any of the below options, Vault will be accessible on http://localhost:8200.
55-
Extract the root token from the logs of the container.
56+
The root token for development is 'root-token'.
5657

5758
### Setting up with `podman`:
5859

@@ -93,6 +94,8 @@ Cargo makes it easy to run the project's unit and integration tests:
9394
cargo tests
9495
```
9596

97+
**Note that the integration tests need active Vault and PostgreSQL connections, as described [here](#environment-setup).**
98+
9699
Cargo will automatically discover and execute the tests defined within the project.
97100

98101
### Running the CLI

0 commit comments

Comments
 (0)