-
-
Notifications
You must be signed in to change notification settings - Fork 986
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
ci: add test for windows #1029
base: master
Are you sure you want to change the base?
ci: add test for windows #1029
Conversation
031dbb3
to
32d90f3
Compare
32d90f3
to
229e609
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I discovered that the error is in this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can make it work with some tweaks:
#!/usr/bin/env bash
set -e
# Detect OS
OS="$(uname -s)"
# Define file paths
KEY_PATH="./test/fixtures/server.key"
CERT_PATH="./test/fixtures/server.crt"
# Generate the certificate
if [[ "$OS" == "Linux" || "$OS" == "Darwin" || "$OS" == "MINGW"* || "$OS" == "MSYS"* || "$OS" == "CYGWIN"* ]]; then
echo "Running on OS: $OS"
openssl req -x509 -nodes -newkey rsa:2048 \
-keyout "$KEY_PATH" \
-out "$CERT_PATH" \
-days 3650 \
-subj "/C=US/ST=Illinois/L=Chicago/O=node-express-session/CN=express-session.local"
else
echo "Unsupported OS: $OS"
exit 1
fi
echo "Certificate generated successfully at: $CERT_PATH"
So far seems like the -subj
argument is the problem on the win environment (ref):
++ uname
+ OS=MINGW64_NT-10.0-20348
+ '[' MINGW64_NT-10.0-20348 = Linux ']'
+ '[' MINGW64_NT-10.0-20348 = Darwin ']'
+ openssl req -x509 -nodes -newkey rsa:2048 -keyout ./test/fixtures/server.key -out ./test/fixtures/server.crt -days 3650 -subj //C=US//ST=Illinois//L=Chicago//O=node-express-session//CN=express-session.local
......+..+.+..+...+....+.....+..................+......+....+..+.+..+...............+...+...+....+...+++++++++++++++++++++++++++++++++++++++*.+..+.......+.....+.+......+..............+......+++++++++++++++++++++++++++++++++++++++*..+..........+...+..............................+......+.....+....+........+.......+..+................+..+.+......+.....+.+..+...+...+......+......+..........+..+..................+....+...+........+..........+..+...............+.+......+.....+.+..+............+.+...+..+............................+.....+....+.....+...+........................+...+.+..+...+....+..+..........+.........+.........+.....+...+....+...........+....+......+..+.............+...............+..+...........................+.+...+.....++++++
.+.+........+......+.........+......+....+.........+..+...+................+.........+.....+......+....+...........+.+.....+.+...+..+...+............+...+.+......+++++++++++++++++++++++++++++++++++++++*..+....+..............+.+.....+....+.........+.....+.+..+.......+...........+....+...+.....+...+.+.........+...............+.....+.+...+..+................+........+.........+...+....+........+++++++++++++++++++++++++++++++++++++++*..+.....+.........+.+......+...+...+..+.............+............+.....+.+...............+.....+.+........+.+.....+....+..+..................+.+..+....+...+..+.+..+...+....+.....+....+..+........................................+...+...........+.+..+.....................+......+...+......+.+.....+.+...+..............+...............+.+.....+.+......+...+...............+.....+......+.........+................+.....+..................+.+..+....+...+.....+.+..+...............+....+.....+...+.......+..............+.+......++++++
-----
req warning: Skipping unknown subject name attribute "/C"
req warning: Skipping unknown subject name attribute "/ST"
req warning: Skipping unknown subject name attribute "/L"
req warning: Skipping unknown subject name attribute "/O"
req warning: Skipping unknown subject name attribute "/CN"
-subj "/C=US/ST=Illinois/L=Chicago/O=node-express-session/CN=express-session.local" | ||
OS=$(uname) | ||
|
||
if [ "$OS" = "Linux" ] || [ "$OS" = "Darwin" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to reverse this if? I mean, should we check that if the OS is Windows, then use the alternative command.
The CI currently tests in windows and linux, but BSD and other similar systems are supported as far as I know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Easy switch case could be:
case "$(uname)" in
MINGW*) ... ;;
*) ... ;;
esac
Related nodejs/citgm#1095 (comment)