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

Fixing bug with other 'ps' commands besides 'ps:exec' #51

Merged
merged 1 commit into from
Jan 2, 2025
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
31 changes: 27 additions & 4 deletions bin/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -euo pipefail
set -eo pipefail

assert_equal() {
local expected="${1}"
Expand Down Expand Up @@ -110,14 +110,37 @@ git init
web="ruby -rwebrick -e\"s=WEBrick::HTTPServer.new(:BindAddress => '0.0.0.0', :Port => \$PORT, :DocumentRoot => Dir.pwd); s.mount_proc('/'){|q,r| r.body='Hello'}; s.start\""
echo "web: ${web}" > Procfile
echo "worker: echo 'success' > ${file_to_copy}; ruby -rwebrick -e'WEBrick::HTTPServer.new(:Port => 3000, :DocumentRoot => Dir.pwd).start'" >> Procfile
cat <<-EOF > Gemfile
source "https://rubygems.org"
ruby "3.2.6"
gem "webrick"
EOF
cat <<-EOF > Gemfile.lock
GEM
remote: https://rubygems.org/
specs:
webrick (1.9.0)

PLATFORMS
ruby
x86_64-linux

DEPENDENCIES
webrick

RUBY VERSION
ruby 3.2.6p234

BUNDLED WITH
2.4.19
EOF

echo "Creating Heroku app..."
heroku create ${app} $(if [ -n "$HEROKU_SPACE" ]; then echo "--space $HEROKU_SPACE"; else echo "--region ${HEROKU_REGION:-us}"; fi)

trap "{ cleanup ${app}; }" EXIT

heroku buildpacks:set https://github.com/ryandotsmith/null-buildpack
git add Procfile
git add Procfile Gemfile Gemfile.lock
git commit -m "first"

if [ "${1-}" == "staging" ] || [ "${HEROKU_EXEC_TEST_ENV-}" == "staging" ]; then
Expand Down Expand Up @@ -147,7 +170,7 @@ assert_contains "Could not connect to dyno!" "$output"
echo "=== test 2: success"

echo "Deploying..."
git push heroku master
git push heroku main

wait_for_dyno "web"

Expand Down
2 changes: 1 addition & 1 deletion commands/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function * run(context, heroku) {
if (fs.existsSync(dest)) {
cli.error(`The local file ${cli.color.white.bold(dest)} already exists!`)
} else {
yield exec.initFeature(context, heroku, function *(configVars) {
yield exec.initFeature(context, heroku, 'copy', function *(configVars) {
yield exec.updateClientKey(context, heroku, configVars, function(privateKey, dyno, response) {
var message = `Connecting to ${cli.color.cyan.bold(dyno)} on ${cli.color.app(context.app)}`
cli.action(message, {success: false}, co(function* () {
Expand Down
4 changes: 2 additions & 2 deletions commands/port.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = function(topic, command) {
};

function * run(context, heroku) {
yield exec.initFeature(context, heroku, function *(configVars) {
yield exec.initFeature(context, heroku, 'forward', function *(configVars) {
const portMappings = context.args.port.split(',').map(function(portMapping) {
const ports = portMapping.split(':')

Expand All @@ -50,7 +50,7 @@ function * run(context, heroku) {
socks.connect({
host: '0.0.0.0',
port: remotePort,
proxyHost: '127.0.0.1',
proxyHost: 'localhost',
proxyPort: socksPort,
auths: [ socks.auth.None() ]
}, function(socket) {
Expand Down
2 changes: 1 addition & 1 deletion commands/socks.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = function(topic, command) {
};

function * run(context, heroku) {
yield exec.initFeature(context, heroku, function *(configVars) {
yield exec.initFeature(context, heroku, 'socks', function *(configVars) {
yield exec.createSocksProxy(context, heroku, configVars)
});
return new Promise(resolve => {})
Expand Down