Coder Social home page Coder Social logo

spiderling-utils's Introduction

I am currently looking for backend software work, senior level. Majoring in PHP or TypeScript, minoring in devops for all hosted CI platforms. I am UK-based and prefer fully/mostly remote. Please contact me through the platform you found me on. This README is intended to be a better summary of my work profile than a bare repo list. Most of my outside-work code is in private repos. Feedback welcome!

Stuff I've done

๐Ÿ‘จโ€๐Ÿซ Currently volunteering as a coach at Codebar
โœ๏ธ I'm a 20K "Trusted User" and curator on Stack Overflow (1.5K answers & 117K edits)
โš™๏ธ I've 2.6K posts to help folks with using CircleCI
๐Ÿค– I'm building an AI / ChatGTP-powered project with two product SMEs (all under wraps for now ๐Ÿค)
๐Ÿ˜‡ I used to teach PHP in-person, and wrote this book-length tutorial

Code & experiments

๐Ÿ‘ They're not native to AWS, but I got PHP lambdas to work
โ†”๏ธ I wrote a shared-hosting file sync system, which is in production use
๐Ÿงช๏ธ I did some experiments with Docker Swarm (39 โญ)
โš—๏ธ And here's another one

spiderling-utils's People

Contributors

halfer avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

spiderling-utils's Issues

Get HHVM support working in Travis

I've tried adding hhvm to a branch in the Travis config, and it did not work. Here are the docs for the HHVM web server.

Possibilities:

  • The server script needs to reference hhvm and not php
  • The parameters to get the web server running seem to be different from the PHP ones

I don't need this right now, but am open to receiving PRs. The branch where this is started is hhvm-travis.

Add support for PHPUnit 6

PHPUnit 6 introduces namespaces to the test system, and specifies PHP 7.0 as a minimum version. PHPUnit Spiderling now has moved to support PHPUnit 6 only, so I can make use of that. However I am not ready to drop support for PHP 5 just yet, so I will see if I can support both.

A documentation update will be required here too.

A separate set of unit tests will need to be run in Travis, but only for PHP 7.0 and 7.1.

Handle non-Bash environments

The server.sh script has a hash-bang requiring Bash, which will not work in non-Bash environments. I could require there to be a shell command to prefix this script, or I could assume Bash is the default, and then try to detect it, and throw an error if it is not available and an alternative is not set.

Presently, I will just add a Server method to specify this.

For Server instances without a check-alive URL, perform a default check-alive

A Server without a check-alive will try to run tests before the server has had chance to stabilise:

php vendor/bin/phpunit 
PHPUnit 6.1.0 by Sebastian Bergmann and contributors.

E                                                                   1 / 1 (100%)

Time: 87 ms, Memory: 2.00MB

There was 1 error:

1) halfer\SpiderlingUtils\NamespaceDemo\SimpleTest::testAnything
Openbuildings\Spiderling\Exception_Curl: Curl: Download Error: Failed to connect to localhost port 8090: Connection refused, status 0 on url http://localhost:8090/

.../vendor/openbuildings/spiderling/src/Openbuildings/Spiderling/Driver/Simple/RequestFactory/HTTP.php:87
.../vendor/openbuildings/spiderling/src/Openbuildings/Spiderling/Driver/Simple.php:227
.../vendor/openbuildings/spiderling/src/Openbuildings/Spiderling/Driver/Simple.php:182
.../vendor/openbuildings/spiderling/src/Openbuildings/Spiderling/Driver/Simple.php:420
.../vendor/openbuildings/spiderling/src/Openbuildings/Spiderling/Page.php:33
.../vendor/openbuildings/phpunit-spiderling/src/TestCase.php:181
.../test/SimpleTest.php:14

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.

As a result of this crash, the code to clean up the forked server does not run, and it persists until manually killed.

A default check-alive should be added to this, unless it is explicitly turned off.

Redirecting web server stdout to /dev/null causes PhantomJS to exit early

I tried to apply this change to the web server:

diff --git a/src/scripts/server.sh b/src/scripts/server.sh
index c1b2d17..346bb57 100755
--- a/src/scripts/server.sh
+++ b/src/scripts/server.sh
@@ -30,7 +30,7 @@ PID_FILE=$3
 ROUTER_SCRIPT=$4
 
 # Start up built-in web server with router script
-php -S $SERVER_ADDR $DOC_ROOT $ROUTER_SCRIPT 2> $ERROR_FILE &
+php -S $SERVER_ADDR $DOC_ROOT $ROUTER_SCRIPT > /dev/null 2> $ERROR_FILE &
 
 # Let the server settle down
 sleep 1

However, this results in PhantomJS exiting early after a test, for reasons I just can't fathom, even after many hours of debugging.

What I am actually trying to fix is that in another repo, I am instantiating a server using Spiderling Utils, in order to run a browser test. The test fails (as expected) but I get this unexpected output:

Error when running server script: `PHP 7.0.28 Development Server started at Sun Mar 25 13:09:52 2018`

My redirecting stdout was an attempt to fix this, but it causes inexplicable problems in the tests here. I will try to fix this with a custom script for now, but I need to come back to this.

Add PhantomJS demo for PHPUnit 6

The small demo project for PHPUnit 6 only uses the simple driver, it would be good to exercise the phantomjs driver here too.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.