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 updates #119

Merged
merged 4 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion integration/node/features/support/decrypt.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ const fileDirectory = "/tmp/";
var encryptedPayload;
var decryptedPayload;

var adoDatabaseHost = process.env.TEST_DB_HOSTNAME;
var adoDatabaseName = process.env.TEST_DB_NAME;
var adoUsername = process.env.TEST_DB_USER;
var adoPassword = process.env.TEST_DB_PASSWORD;
var adoPort = process.env.TEST_DB_PORT;
var adoConnectionString = adoUsername+":"+adoPassword+"@tcp(localhost:"+adoPort+")/"+adoDatabaseName+"?tls=false"
var adoConnectionString = adoUsername+":"+adoPassword+"@tcp("+adoDatabaseHost+":"+adoPort+")/"+adoDatabaseName+"?tls=false";

Given('I have encrypted_data from {string}', async function (string) {
var payload = fs.readFileSync(fileDirectory + string, 'utf8');
Expand Down
3 changes: 1 addition & 2 deletions integration/node/features/support/encrypt.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ const { Given, When, Then } = require('@cucumber/cucumber')
const assert = require('assert');
const asherah = require("asherah");
const fs = require("fs");
const os = require("os");

const fileDirectory = os.tmpdir() + "/";
const fileDirectory = "/tmp/";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the working directory for all cross-language tests in the suite. For example, asherah-go encrypts a test payload and writes it to a file in /tmp which is then loaded and decrypted by the asherah-node package (and vice versa).

As it is now, asherah-node's encryption output is not found by the downstream tests in this expected location, resulting in the errors described in #120

See:
asherah-node decrypt:

const fileDirectory = "/tmp/";

asherah-go: https://github.com/godaddy/asherah/blob/main/tests/cross-language/go/const.go#L10

const fileName = "node_encrypted";

let payloadString;
Expand Down
252 changes: 47 additions & 205 deletions integration/node/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading