Comments (6)
Again:
process.env.PARTITION
is not provided or controller by this addon. It would be set as an environment variable for the process
This means that yes, you must set it in your environment.
If you're hoping to use this with the --parallel
option then it won't work properly since the config/environment
is only generated once per build, meaning that partition numbers will not be available within that module. Splitting is done at run time, so unless you're only running a single partition (as in the example you gave above), it isn't possible to know the partition at build time.
Your only real option for doing this at run time is to check the query parameters.
from ember-exam.
So a couple things:
process.env.PARTITION
is not provided or controller by this addon. It would be set as an environment variable for the process if you do something like:PARTITION=2 ember exam
. (I might need to clarify that in the README).- I'd be very wary of why you need this in your acceptance tests (or any test for that matter) as one of the major benefits of splitting/randomizing tests is that your tests don't know the order/context in which they are running so that you have better guarantees of their autonomy.
from ember-exam.
I'd be very wary of why you need this in your acceptance tests
i know it sounds strange, but our acceptance tests works with real backend, and at the beginning of every acceptance test we need to 'login' test user, but login works in such way - when you login in one place, backend terminates other session, and parallel tests fail because of that.
so if there would be information about partitions it would be possible to use different test logins for different partitions.
Maybe i am doing something wrong and there is better solution for my problem?
from ember-exam.
Seems reasonable. As long as you're not directly supplying the tests with the partition number, then I think it makes sense. I would likely do something like:
// config/environment.js
var USERS = [
// user login information
];
module.exports = function() {
var partition = process.env.PARTITION;
return {
testUser: USERS[partition]
};
};
from ember-exam.
@trentmwillis thanks for reply
i tried almost exact solution, but it is not working out of the box,
if i don't pass manually PARTITION
variable, process.env.PARTITION
is undefined
in config file
But to manually specify PARTITION
i need to run separate processes, with ugly looking command
PARTITION=1 ember exam --split 4 --partition 1 --server --query="hidepassed=true&nojscs=true&nolint=true" &
PARTITION=2 ember exam --split 4 --partition 2 --server --query="hidepassed=true&nojscs=true&nolint=true" &
PARTITION=3 ember exam --split 4 --partition 3 --server --query="hidepassed=true&nojscs=true&nolint=true" &
PARTITION=4 ember exam --split 4 --partition 4 --server --query="hidepassed=true&nojscs=true&nolint=true"
am i right?
from ember-exam.
Your only real option for doing this at run time is to check the query parameters.
Thanks, i'll try this way.
from ember-exam.
Related Issues (20)
- Passing the `--load-balance` flag changes partitions HOT 3
- Halts when waiting for a browser to exit after TestLoader Failure HOT 1
- Cut a new release HOT 1
- Embroider Support HOT 1
- How can I determine the max num in `parallel=<num>` based on my CPU limitations? HOT 2
- What version of ember cli is required to run with load balancing? HOT 2
- Ember serve not running full tests
- Usage documentation and options are extremely confusing HOT 4
- 'ember exam --server' doesn't work with ember-cli 3.19.0 to 3.20.0 update HOT 5
- Magic Number of Parallel HOT 2
- The link to the documentation website is broken HOT 2
- Does not work properly with [email protected]
- Could not find module `qunit` imported from `(require)` HOT 4
- usage of the --path option (and other valid ember test options) needs clarification
- Update documentation about load balancing prerequisites HOT 1
- App won't build with ember-exam 6.1.0 and ember-mocha HOT 4
- Reported test count is different when running exam than when running test HOT 1
- Ember Auto Import v2 issue with test-support HOT 1
- Dependency Dashboard
- environment test not set when configuring polly without --environment=test
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-exam.