Skip to content

Commit a545585

Browse files
authored
Fix/mitigate random failing builds (#46)
* ensure random strings start with a letter * ignore wp-content * require dev external packages to cache composer * retry composer install if necessary * don’t cache vendor * sort packages
1 parent 783a3a7 commit a545585

4 files changed

Lines changed: 11 additions & 8 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ node_modules/
44
vendor/
55
.idea
66
/wordpress
7+
/wp-content

.travis.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ php:
66
- 7.0
77
- 5.6
88

9-
install: composer install
9+
install: travis_retry composer install
1010

1111
before_script:
1212
- composer validate --strict
@@ -15,10 +15,6 @@ before_script:
1515

1616
script: composer run-behat
1717

18-
cache:
19-
directories:
20-
- vendor
21-
2218
notifications:
2319
email:
2420
on_success: never

composer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,16 @@
2727
"php": ">=5.5",
2828
"illuminate/container": "^5.1",
2929
"symfony/filesystem": "^2.7 || ^3 || ^4",
30-
"wp-cli/wp-cli": "^1 || ^2",
3130
"wp-cli/config-command": "^1 || ^2",
3231
"wp-cli/core-command": "^1 || ^2",
33-
"wp-cli/db-command": "^1 || ^2"
32+
"wp-cli/db-command": "^1 || ^2",
33+
"wp-cli/wp-cli": "^1 || ^2"
3434
},
3535
"require-dev": {
36+
"aaemnnosttv/wp-sqlite-db": "^1.0",
3637
"behat/behat": "~2.5",
38+
"koodimonni/composer-dropin-installer": "^1.2",
39+
"roots/bedrock": "^1.8",
3740
"wp-cli/entity-command": "^1 || ^2",
3841
"wp-cli/eval-command": "^1 || ^2",
3942
"wp-cli/scaffold-package-command": "^0.5.0"
@@ -66,5 +69,8 @@
6669
"pre": "TROUBLESHOOTING.md"
6770
}
6871
}
72+
},
73+
"config": {
74+
"sort-packages": true
6975
}
7076
}

features/steps/given.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,5 +161,5 @@ function($world) {
161161
});
162162

163163
$steps->Given('/^a random string as {(\w+)}$/', function($world, $var_name) {
164-
$world->variables[ $var_name ] = substr(md5(uniqid('', true)), 0, 8);
164+
$world->variables[ $var_name ] = substr(uniqid('v'), 0, 8); // ensure the string starts with a letter
165165
});

0 commit comments

Comments
 (0)