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

Revert docker-compose exec to docker-compose run #50412

Closed
wants to merge 2 commits into from
Closed
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
6 changes: 1 addition & 5 deletions packages/env/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### Breaking Change

- Docker containers now run as the host user. This should resolve problems with permissions arising from different owners
between the host, web container, and cli container. If you still encounter permissions issues, try running `npx wp-env destroy` so that the environment can be recreated with the correct permissions.
between the host, web container, and cli container. If you still encounter permissions issues, try running `npx wp-env destroy` so that the environment can be recreated with the correct permissions.

### New feature

Expand All @@ -18,10 +18,6 @@ between the host, web container, and cli container. If you still encounter permi

- Ensure `wordpress`, `tests-wordpress`, `cli`, and `tests-cli` always build the correct Docker image.

### Enhancement

- `wp-env run ...` now uses docker-compose exec instead of docker-compose run. As a result, it is much faster, since commands are executed against existing services, rather than creating them from scratch each time.

## 6.0.0 (2023-04-26)

### Breaking Change
Expand Down
4 changes: 1 addition & 3 deletions packages/env/lib/commands/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,10 @@ function spawnCommandDirectly( config, container, command, envCwd, spinner ) {
// We need to pass absolute paths to the container.
envCwd = path.resolve( '/var/www/html', envCwd );

const isTTY = process.stdout.isTTY;
const composeCommand = [
'-f',
config.dockerComposeConfigPath,
'exec',
! isTTY ? '--no-TTY' : '',
'run',
'-w',
envCwd,
'--user',
Expand Down
6 changes: 3 additions & 3 deletions phpunit/class-override-script-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function test_localizes_script() {
);

$script = $wp_scripts->query( 'gutenberg-dummy-script', 'registered' );
$this->assertEquals( array( 'dependency', 'wp-i18n' ), $script->deps );
$this->assertEquals( array( 'dependency' ), $script->deps );
}

/**
Expand All @@ -60,7 +60,7 @@ public function test_replaces_registered_properties() {

$script = $wp_scripts->query( 'gutenberg-dummy-script', 'registered' );
$this->assertEquals( 'https://example.com/updated', $script->src );
$this->assertEquals( array( 'updated-dependency', 'wp-i18n' ), $script->deps );
$this->assertEquals( array( 'updated-dependency' ), $script->deps );
$this->assertEquals( 'updated-version', $script->ver );
$this->assertSame( 1, $script->args );
}
Expand All @@ -82,7 +82,7 @@ public function test_registers_new_script() {

$script = $wp_scripts->query( 'gutenberg-second-dummy-script', 'registered' );
$this->assertEquals( 'https://example.com/', $script->src );
$this->assertEquals( array( 'dependency', 'wp-i18n' ), $script->deps );
$this->assertEquals( array( 'dependency' ), $script->deps );
$this->assertEquals( 'version', $script->ver );
$this->assertSame( 1, $script->args );
}
Expand Down