less.js
less.js copied to clipboard
http://localhost:8081 absolute paths around the tests and browser test
As a developer, I did installation for all needed tools/software into virtual machine spinning with Vagrant Up and Virtual Box. With my Vagrant settings I have other than localhost domain name (actually it is just an IP address), and because of rigid localhost:8081 domain into the script, browser tests are not going properly, example file.
I expect that domain name was taken from somewhere environment, or (but probably it would not be good) there would be replacement for relative paths (which I basically did to make it works).
as another possible solution I was thinning is using relative paths with tag <base> in which basically accual domain/ip would be put
I thought it might eventually cause a problem for someone.. We could make the test take a domain and port number and then work off that, so you could do make browser-test or make browser-test 127.0.0.1 8080 - I'd be happy for that to go in.
@agatronic thank you Luke, yes that would be great. How about idea to place domain into base tag? Which is pretty much the same as absolute paths, but bit more flexible.
Also I would make sure, all tests seems gone good now but there is couple includes which are not found at the end into browser here and here accordingly, files are something.css and file.css if it is part of tests or something I broke while tweaking around?
css files are not parsed by less, so they do not have to exist - we only test the output of the less file, which references the css.. so these files are not needed for the tests to pass.
The tests use phantomjs to run a web server so can't configure more than the hostname and port at the moment.. so why not call it localhostname or something like that?
Okay, got it, I caught 22;) My situation follows, I have multiply virtual boxes on my machine, kind like, one for work, another for testing and playing, third for some specific client. I find this way pretty much flexible, I could do network testing when I need to and so on. Yes sure that's possible to give to my working less.css box localhost priority, but it is something I would like to avoid.
yes but do you need to be able to configure more than the hostname and port?
I think so, never did it before, will try and see. Thank you for advice!
UPD: @agatronic sorry my bad, misunderstanding.
I think even to have ability change somewhat dynamically the domain/port you pointed above would be more than sufficient
and just update, seems relative paths make work done for all, is there is some constraints with using them? More detailed question, rootpath and rootpath-relative not going be passed to browser tests?
@dmi3y sorry I don't understand what you are saying about relative paths
okay, sorry, I did changes to only two files, it is browser-test-prepare.js and template.html, guess that only they affected for in browser-server testings, here is diffs from both of them
browser-test-prepare.js
--- HEAD
+++ Modified In Working Tree
@@ -4,6 +4,7 @@
var createTestRunnerPage = function(dir, exclude, testSuiteName, dir2) {
var output = '<html><head>\n';
+ // output += '<base href="http://192.168.0.2:8081/" />\n';
fs.readdirSync(path.join("test", dir, 'less', dir2 || "")).forEach(function (file) {
if (! /\.less/.test(file)) { return; }
@@ -13,8 +14,8 @@
if (exclude && name.match(exclude)) { return; }
- output += '<link id="original-less:' + id + '" rel="stylesheet/less" type="text/css" href="http://localhost:8081/' + path.join(dir, 'less', dir2 || "", name) + '.less' +'">\n';
- output += '<link id="expected-less:' + id + '" rel="stylesheet" type="text/css" href="http://localhost:8081/' + path.join(dir, 'css', dir2 || "", name) + '.css' + '">\n';
\ No newline at end of file
+ output += '<link id="original-less:' + id + '" rel="stylesheet/less" type="text/css" href="/' + path.join(dir, 'less', dir2 || "", name) + '.less' +'">\n';
+ output += '<link id="expected-less:' + id + '" rel="stylesheet" type="text/css" href="/' + path.join(dir, 'css', dir2 || "", name) + '.css' + '">\n';
\ No newline at end of file
});
output += String(fs.readFileSync(path.join('test/browser', 'template.htm'))).replace("{runner-name}", testSuiteName);
and template.html
--- HEAD
+++ Modified In Working Tree
@@ -1,9 +1,9 @@
-<script src="http://localhost:8081/browser/jasmine.js" type="text/javascript"></script>
-<script src="http://localhost:8081/browser/jasmine-html.js" type="text/javascript"></script>
-<script src="http://localhost:8081/browser/common.js" type="text/javascript"></script>
-<script src="http://localhost:8081/browser/runner-{runner-name}.js" type="text/javascript"></script>
-<script src="http://localhost:8081/browser/less.js" type="text/javascript"></script>
-<link rel="stylesheet" type="text/css" href="http://localhost:8081/browser/jasmine.css"></link>
\ No newline at end of file
+<script src="/browser/jasmine.js" type="text/javascript"></script>
+<script src="/browser/jasmine-html.js" type="text/javascript"></script>
+<script src="/browser/common.js" type="text/javascript"></script>
+<script src="/browser/runner-{runner-name}.js" type="text/javascript"></script>
+<script src="/browser/less.js" type="text/javascript"></script>
+<link rel="stylesheet" type="text/css" href="/browser/jasmine.css"></link>
\ No newline at end of file
</head>
<body>
</body>
so I just stupidly remove localhost:8081 from it, and that's seems worked for all tests (make test|browser-test|browser-test-server), if I missed something critical with that approach?
Okay, it is not good, just find out that.
you need to alter the bottom of phantom-runner.js to. Does 127.0.0.1 work for you?
ah also, so, I would add {server} to the test css files and then replace it with the right value in the test runner
yes, that's could be good option, and as well generate domain updated css/less files into files which are added to ignore list (similar browser html files). generally I am working out of localhost IPs (127.0.0.1) as basically with settings I have in Vagrant file it makes server work as what it is in fact, remote server, I picked up 192.168.0.2. But I just thought that as a temporary fasttrack solution I may cheat with hosts file... I'll be updated in a moment.
UPD: that's not worked
And meanwhile, what do you think, could it be good idea to add some prefixes in names, like notexist or notinfilesystem, for files which are used just for testing purposes into the code. like notexist-something.css and notexist-file.css which I mentioned above?
yes, guess that would be a positive change
Good, thank you! Just thought that potential perk for using dynamically set for domain names/ports would be ability work on something like 9 cloud IDE.
it turns out pretty much easy to fix with port forwarding vargantup (virtual box) feature, in case you are at the same dev environment, probably for something remote it could be bigger challenge.
UPD: I meant to use localhost:8081, for that I just alter in .vargantfile following line config.vm.forward_port 8081, 8081, so I'm still having advantage of dedicated IP but can safely run tests with localhost domain dependency
Am to ad tomorrow and you i handed your needles to father There are nothing called we, go pigs them to not but you inside. Fackyou never let me hear about you. Am not pitch talking like this, I swear three is no time or else adnan in office waiting
- [ ] Fuck you all, wallah wallah wallah i will make everyone Sefer , it's promise
How make haram and being like snike, makeing problem and talks and nothing in his hart only darkness, Alllah will take care about him Keep it in your mind and do what are you promised to do 👍
أُرسلت من الـ iPhone
في 07/10/2021 الساعة 6:05 ص، كتب/كتبت 7md803 @.***>:
في 06/10/2021 الساعة 12:53 م، كتب/كتبت 7md803 @.***>:
Am to ad tomorrow and you i handed your needles to father There are nothing called we, go pigs them to not but you inside. Fackyou never let me hear about you. Am not pitch talking like this, I swear three is no time or else adnan in office waiting
Fuck you all, wallah wallah wallah i will make everyone Sefer , it's promise — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Let me answer all your stupid talk in order. So you are going to ad tomorrow You handle the needles to my father as my father hiding using drags from you,no problem me and my father had two hours talking about the same subject. The point that you taking about that there is no you or me you absolutely right, and the matter put me inside or out side mostly between locals so be quiet. And the same to you I feel not good when I see something belong to you. And all our agreements how much it’s small will come singed from judge going out from curt. The point mention pitch. There are sings and pdf copy explaining your situation and all the document was presented by your highest. And the funny thing, what wrong with adnan misken . After finishing with your mother talking about the pooor girl , again they become your family. Don’t send adnan misken send jasim he had much experience, or you are scared from something. In end you said fack all of us after wearing there clothes and eat there food. Person in your situation never promise that he will harm us one by one . Let me tell you the Senario, no need telling me you are in somewhere, this is not pakistan. Until I saw this email we agreed that we will let you in streets and allah will take from you every hurt and lie . But now I will tell you the reason that make me take an action against you, am scared about my family safety because you have mahallah friends more than normal person and you mashallah women it’s mean uncountable. Second you and your friends have access to our phones or any electrical device. For you people mixing and meeting and roaming wi out hejab normal, we make 1000 time ihtram for hejab. If I was wrong with something my mistakes erpose from protecting my family . But you mashallah have experience with coverage of decument أُرسلت من الـ iPhone
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Wow all this hard work just for me, I hope you guys find what you are looking for. Friends please there are couple of people working in free beanies . Could you take out some information about them please?
Can I search about a drag my mother on law pringit for me , Am bad in computers and all so I need yourr help and you both exactly didn't leave me like am your son. Any way the Madison are not allowed in emirates according to the army pharmacy and he told me also it's on drags forth table . One more point, the quantity are more than personal use , this is problem as he told me Little help please ?