Skip to content

Commit 6fb02e0

Browse files
committed
fixed certificate filenames between local and ci
1 parent 4e1bde6 commit 6fb02e0

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,16 @@ jobs:
2727
RABBITMQ_DEFAULT_USER: "test-user"
2828
RABBITMQ_DEFAULT_PASS: "test-password"
2929
ports:
30+
- 5671:5671
3031
- 5672:5672
3132
- 15672:15672
3233
volumes:
33-
- ./conf/:/etc/rabbitmq/
34+
- ${{ github.workspace }}/conf/:/etc/rabbitmq/
35+
- ${{ github.workspace }}/certs/:/certs/
3436

3537
steps:
38+
- name: Add the rabbitmq service to /etc/hosts
39+
run: sudo echo "127.0.0.1 test-node" | sudo tee -a /etc/hosts
3640
- uses: actions/checkout@v3
3741
- name: Use Node.js ${{ matrix.node-version }}
3842
uses: actions/setup-node@v3
@@ -65,6 +69,7 @@ jobs:
6569
docker exec test-node rabbitmqctl set_permissions 'O=client,CN=test-node' '.*' '.*' '.*'
6670
- run: npm test
6771
env:
72+
CN: test-node
6873
RABBITMQ_USER: "test-user"
6974
RABBITMQ_PASSWORD: "test-password"
7075
# - run: cd example && npm install && npm start

test/e2e/tls_connection.test.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import { describe, expect, test } from "vitest"
22
import { createEnvironment, Environment } from "../../src/environment.js"
3-
import {
4-
host,
5-
username,
6-
eventually,
7-
numberOfConnections,
8-
password,
9-
} from "../support/util.js"
3+
import { host, username, eventually, numberOfConnections, password } from "../support/util.js"
104
import { Connection } from "../../src/connection.js"
115
import { readFile } from "fs/promises"
126

@@ -15,11 +9,12 @@ describe("TLS Connection", () => {
159
let connection: Connection
1610

1711
test("creating a TLS connection", async () => {
12+
const cn = process.env.CN ?? "rabbitmq"
1813
const tls = {
1914
ca: await readFile("./tls-gen/basic/result/ca_certificate.pem", "utf8"),
20-
cert: await readFile(`./tls-gen/basic/result/client_rabbitmq_certificate.pem`, "utf8"),
21-
key: await readFile(`./tls-gen/basic/result/client_rabbitmq_key.pem`, "utf8"),
22-
rejectUnauthorized: true
15+
cert: await readFile(`./tls-gen/basic/result/client_${cn}_certificate.pem`, "utf8"),
16+
key: await readFile(`./tls-gen/basic/result/client_${cn}_key.pem`, "utf8"),
17+
rejectUnauthorized: true,
2318
}
2419

2520
environment = createEnvironment({ host, port: 5671, username, password, tls })

0 commit comments

Comments
 (0)