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

On returning HTML and plain text message bodies #36

Closed
kevinsmith opened this issue Mar 7, 2014 · 13 comments
Closed

On returning HTML and plain text message bodies #36

kevinsmith opened this issue Mar 7, 2014 · 13 comments

Comments

@kevinsmith
Copy link
Contributor

I notice Fetch will always return an HTML or plain text body when requested, even if the original message doesn't actually contain an HTML or plain text version. I have a need where I actually want to only return the HTML and/or plain text if the original message included it. Of course, I can extend Fetch for my needs, but it feels like this might be a general enough use that others would benefit. I'm happy to fork it, code it up (backwards-compatible, of course), and issue a pull request if you like, but I wanted to see if that's even something you want Fetch to do before I did anything.

@kevinsmith
Copy link
Contributor Author

Don't mind me, I just noticed pull #32 adds this.

@Arcesilas
Copy link

Like you, I can't get the Fetch Test Suite running properly... That's why #32 is still a request and has not been merged yet.
I don't have enough time to work on that problem, so the request might still be a request for a while...

@kevinsmith
Copy link
Contributor Author

Yeah, even with Vagrant, I'm thinking Fetch's test suite is still too specific to @tedivm's machine. I'll try playing around with it again in the next few days to see if I can get it working.

@tedivm
Copy link
Member

tedivm commented Mar 7, 2014

I'm happy to help you guys figure out what's going on. I can tell you that I'm not the only one who has used the test suite successfully though.

What machine are you running on and what's the error? Are you guys sure you have the imap extension installed on your machine?

@Arcesilas
Copy link

Actually, I can have the test suit work, but only get 2 tests passed successfully.
Here what I just got right now : https://gist.github.com/OlivierCecillon/1910b47b3d1f438330bf
Here is what I got earlier this afternoon : https://gist.github.com/OlivierCecillon/86680119aaf32ce6382d (sorry, locale was FR at this moment)

@kevinsmith
Copy link
Contributor Author

The first big problem I'm running into is an error when I run phpunit that says

/bin/bash: /Users/username/Sites/repos/Fetch/tests/vendor/tedivm/dovecottesting/SetupEnvironment.sh: No such file or directory

It's because __DIR__ in bootstrap.php is returning /Users/username/Sites/repos/Fetch/tests/ and the vendor directory is a sibling rather than a child of tests. I can fix it by editing bootstrap.php, but that sets off a cascade of other errors. Since I'm assuming that shouldn't have to be done, I suspect I've set something up incorrectly. Rather embarrassing– I'm just not sure what it is.

@Arcesilas
Copy link

Well, I did not think of it anymore, but I had the same problem... Had to correct it manually to get it work...

@tedivm
Copy link
Member

tedivm commented Mar 14, 2014

Sorry about this guys- I had these issues corrected, which is why I was confused here, but it appears I never merged those changes back into the mainline. I merged that in as part of #41 so please give things another try.

@Arcesilas
Copy link

Hi. Thanks for the update. Unfortunately, I still run the same errors.

https://gist.github.com/OlivierCecillon/fecd51a94a57b1c3cc36

Some tests are successfully passed and some are definitely not...

It seems it's all related to the same problem : the client can't connect to the server (172.31.1.2) neither on port 143 nor on 993.
But I can ping it:

ping 172.31.1.2
PING 172.31.1.2 (172.31.1.2) 56(84) bytes of data.
64 bytes from 172.31.1.2: icmp_req=1 ttl=64 time=0.269 ms
64 bytes from 172.31.1.2: icmp_req=2 ttl=64 time=0.261 ms

Don't really know where ti dig since I'm not much comfortable with Vagrant and phpunit...

@tedivm
Copy link
Member

tedivm commented Mar 14, 2014

Can you go into vendor/DovecotTesting/vagrant and type "vagrant ssh". Then type "sudo service dovecot restart", wait a minute, and then attempt the test?

I don't know if that'll work or not, but it'll help me narrow things down.

@Arcesilas
Copy link

Ahem... Well... I don't know what to think... I've seen your mail, then before trying to manually start Dovecot, I've run phpunit again...
And...

phpunit
Initializing Environment using Vagrant
Fri Mar 14 22:31:56 UTC 2014
[default] Running provisioner: shell...
[default] Running: /tmp/vagrant-shell20140314-17525-14ruf1k
stdin: is not a tty
Provisioning Environment with Dovecot and Test Messages
Dovecot is already installed
testuser already exists
Refreshing the test mailbox- this could take a minute.
dovecot stop/waiting
dovecot start/running, process 1637
Test mailbox restored.
Environment has been provisioned
Environment Initialized


PHPUnit 3.7.29 by Sebastian Bergmann.

Configuration read from /home/olivier/workspace-repositories/Fetch/Fetch/phpunit.xml.dist

................................................

Time: 2.87 minutes, Memory: 4.25Mb

OK (48 tests, 121 assertions)

Of course, I've not modified a single character. Really. I swear. I was not at home during all day. Just got back home, tried and... it worked... Don't understand...

So hum... For me, the problem is solved (magically ?). When back from holidays, I can write the tests for #32 I've submitted a while ago...

Thanks for your time... Maybe the last update will solve the problem for @kevinsmith ?

@Arcesilas
Copy link

One thing I can say, maybe : I've let my terminal open all day... I know it's not supposed to have any influence since the VM stops after 30 minutes, but... don't know...

@tedivm
Copy link
Member

tedivm commented Mar 16, 2014

Any chance you ran a composer update or fresh install? I did make changes to the test suite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants