title,body,link,tags,view_count,is_answered,score,answer_count
System testing of Control System,"<p>We are developing software for Control System of machinery. In the final product the software will be deployed on an ECU with real time operating system but we have the possibility to run the software on PC in emulation mode. Can we perform System level testing using the PC emulation mode only without the ECU hardware or it would be wrong to call that System testing? If it's not correct then what would be the right test level name to describe this test activity?</p>
",https://stackoverflow.com/questions/59211276/system-testing-of-control-system,"['testing', 'embedded']",97,False,0,0
Full AWS Stack System Testing in Python,"<p>I have lots of unit tests for individual components in my AWS Stack, but i'd like to do functional tests across multiple asynchronous systems.</p>

<p>These systems are asynchronous due to the queues they operate on. One application may take an event and generate multiple queue items in different queues to be processed downstream. Ultimately, i'd like to put an event in one end of my system and see the results at the other end of the system. I already do this manually, but there are many variations i'd like to test, and full-system regression testing for every feature release is becoming a bear to manage.</p>

<p>It often takes minutes for a unit of work to make it through all of the queues, streams, and processes and settle on the other side.</p>

<p><a href=""https://i.stack.imgur.com/XAFfP.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/XAFfP.png"" alt=""function testing""></a></p>

<p>I do know <em>how</em> I could test something like this. But it's not very pretty.</p>

<pre><code>def test_event():
    event = { 'user_id': 1, 'action': 'like_post', 'data': {} }

    put_event_to_queue(event)

    retry_count = 0
    success = False
    while retry_count &lt; 3 and not success:
      time.sleep(60)

      if (is_action_in_rds()
          and is_action_in_elasticsearch()
          and is_action_in_athena()):
          success = True

      retry_count += 1

    self.assertTrue(success)
</code></pre>

<p>My approach would be to put something in the queue to process and check if the result exists after some arbitrary amount of time.</p>

<p>Would this be the standard approach? Is there a testing framework that lends itself best to this sort of testing?</p>
",https://stackoverflow.com/questions/55908333/full-aws-stack-system-testing-in-python,"['python', 'amazon-web-services', 'unit-testing', 'testing', 'continuous-integration']",32,False,0,0
end to end or integration or system testing,"<p>What kind of testing is this? Is the following considered end to end testing or is it an integration testing or a system testing? If not if you can elaborate on the types of testing in context of the code example.</p>

<p>I'm basically calling the endpoint on localhost and asserting on the status/output.</p>

<pre><code>let assert = require(""assert"");
let http = require(""http"");

describe(""EndToEndTesting"", function() {

    describe(""GET /users"", function() {
        it(""should return list of users"", function(done) {
            http.request({
                method: ""GET"",
                hostname: ""localhost"",
                port: 3000,
                path: ""/users""
            }, function(response){
                let buffers = [];
                response.on(""data"", buffers.push.bind(buffers));
                response.on(""end"", function(){
                    let body = JSON.parse(Buffer.concat(buffers).toString());
                    assert(response.statusCode == 200);
                });
            }).on(""error"", console.error).end();
        });
    }
}
</code></pre>
",https://stackoverflow.com/questions/58621937/end-to-end-or-integration-or-system-testing,"['node.js', 'testing', 'integration-testing', 'end-to-end', 'system-testing']",797,True,2,1
Handle &quot;Invalid hex characters in escape&quot; in tomcat level,"<p>Am doing some system testing to URL Sanitation. So I tried rushing the APIs with junk data.Example</p>

<pre><code>http://ipaddress/AppContext/api1?query=%S%n%n%s
</code></pre>

<p>If I call this API , my log throws an exception <code>'Invalid HEX character in escape sequence %n'</code></p>

<p>How to I catch this in tomcat level and throw a <code>400 bad request</code> </p>
",https://stackoverflow.com/questions/56239230/handle-invalid-hex-characters-in-escape-in-tomcat-level,"['rest', 'tomcat', 'utf-8', 'character-encoding']",84,False,-2,1
end to end or integration or system testing,"<p>What kind of testing is this? Is the following considered end to end testing or is it an integration testing or a system testing? If not if you can elaborate on the types of testing in context of the code example.</p>

<p>I'm basically calling the endpoint on localhost and asserting on the status/output.</p>

<pre><code>let assert = require(""assert"");
let http = require(""http"");

describe(""EndToEndTesting"", function() {

    describe(""GET /users"", function() {
        it(""should return list of users"", function(done) {
            http.request({
                method: ""GET"",
                hostname: ""localhost"",
                port: 3000,
                path: ""/users""
            }, function(response){
                let buffers = [];
                response.on(""data"", buffers.push.bind(buffers));
                response.on(""end"", function(){
                    let body = JSON.parse(Buffer.concat(buffers).toString());
                    assert(response.statusCode == 200);
                });
            }).on(""error"", console.error).end();
        });
    }
}
</code></pre>
",https://stackoverflow.com/questions/58621937/end-to-end-or-integration-or-system-testing,"['node.js', 'testing', 'integration-testing', 'end-to-end', 'system-testing']",797,True,2,1
import python dependencies in databricks (unable to import module),"<p>I am having a sample project mypackg structured as below:</p>

<pre><code>- mypackg
    * appcode
        * __init__.py
        * file1.py
        * file2.py
    * dbutils
        * __init__.py
        * file3.py
    * start_point.py
    * __init__.py 
</code></pre>

<p>The code packed into <code>mypackg.zip</code></p>

<p>Working fine on local system testing</p>

<ul>
<li>added to pyspark via <code>sparkContext.addPyFile('path_to_zip')</code> and ran my job</li>
<li>ran like an application via <code>spark-submit --py-files 'path_to_zip' myjob.py</code></li>
</ul>

<p>But, when I try to do the same on Databricks - I am unable to import the module </p>

<pre><code>import urllib 

urllib.request.urlretrieve(""https://github.com/nikhilsarma/spark_utilities/blob/master/mydata.zip"", ""/databricks/driver/mydata.zip"")

sc = spark.sparkContext.getOrCreate() and 
sc.addPyFile('/databricks/driver/mydata.zip')
sys.path.insert(0, r'/databricks/diver/mydata.zip')
sc = spark.sparkContext.getOrCreate()
sc.addPyFile(r'/databricks/driver/mydata.zip') 

from mypackg import start_point
</code></pre>

<p>Error:</p>

<blockquote>
  <p>ModuleNotFoundError: No module named 'mypackg'</p>
</blockquote>
",https://stackoverflow.com/questions/59441557/import-python-dependencies-in-databricks-unable-to-import-module,"['python', 'apache-spark', 'pyspark', 'databricks']",488,True,0,1
System testing of Control System,"<p>We are developing software for Control System of machinery. In the final product the software will be deployed on an ECU with real time operating system but we have the possibility to run the software on PC in emulation mode. Can we perform System level testing using the PC emulation mode only without the ECU hardware or it would be wrong to call that System testing? If it's not correct then what would be the right test level name to describe this test activity?</p>
",https://stackoverflow.com/questions/59211276/system-testing-of-control-system,"['testing', 'embedded']",97,False,0,0
How to define pipeline stage once and using it multiple times,"<p>So I have a use case with Jenkinsfile that I know is not common, and I haven't found a solution for it yet.</p>

<h1>Background</h1>

<p>We currently have a multi-branch pipeline job configured to build multiple branches.  This is uses to run system-testing of the products across multiple release.  The Jenkins job</p>

<ol>
<li>Clone all required repositories</li>
<li>Deploy the environment</li>
<li>Execute the automated test cases</li>
<li>Undeploy the environment</li>
</ol>

<p>In order to avoid having to define the same Jenkinsfile on each branches, we created a shared library.  The shared library defines the Declarative pipeline stages for the Jenkins file.  The shared library has the following:</p>

<pre><code>/* File name var/myStep.groovy */
def call(Map pipelineParams) {
    callASharedLibraryFunction()

    properties([
        parameters(sharedLibraryGetParameters(pipelineParams))
    ])

    pipeline {
        // snip
        stages {
            stage(""clone repos"") { }
            stage(""Deploy environment"") { }
            stage(""Executed Tests"") { }
            stage(""Undeploy environment"") { }
        }
        // post directives
    }
}
</code></pre>

<p>And the Jenkins file simply defines a map, and then call <code>myStep</code> call.</p>

<p>e.g.:</p>

<pre><code>/* Sample Jenkinsfile */
pipelineParams = [
    FOO = ""foo""
]
myStep pipelineParams
</code></pre>

<h1>The problem</h1>

<p>We now have a need for another Jenkins job, where some of the stages will be the same.    For example, the new jobs will need to</p>

<ol>
<li>Clone all required repositories</li>
<li>Deploy the environment</li>
<li>Do something else</li>
</ol>

<p>And changing the behaviour of a common stage (e.g.: Clone the repo), should take effect across all the jobs that define this stage.  I know we can use the <code>when</code> directive in the stage, however from a usability perspective, I want the jobs to be different as they are exercising different things.  And the users of one job don't care about the additional stages the other job runs.</p>

<p>I want to avoid code duplication, and better yet, I don't want to duplicate the stage code. (including <code>steps</code>, <code>when</code>, <code>post</code>, etc..).</p>

<p>Is there a way a shared library can define the stage ""implementation"" with all the directives (<code>steps</code>, <code>when</code>, <code>post</code>, etc) once, but have it get called multiple times?</p>

<p>e.g.:</p>

<pre><code>/* File: vars/cloneReposStageFunction.groovy */
def call() { 
    stage(""Clone Repos"") { }
}

/* File: vars/myStep.groovy */
def call(Map pipelineParams) {
    pipeline {
        // snip
        stages {
            cloneReposStageFunction()
            stage(""Deploy environment"") { }
            stage(""Executed Tests"") { }
            stage(""Undeploy environment"") { }
        }
        // post directives
    }
}

/* File: vars/myNewStep.groovy */
def call(Map pipelineParams) {
    pipeline {
        // snip
        stages {
            cloneReposStageFunction()
            stage(""Deploy environment"") { }
            stage(""Do something else"") { }
        }
        // post directives
    }
}
</code></pre>
",https://stackoverflow.com/questions/54080691/how-to-define-pipeline-stage-once-and-using-it-multiple-times,"['jenkins', 'jenkins-pipeline', 'jenkins-shared-libraries']",1505,True,0,1
Correct combining characters positions with Harfbuzz,"<p>I am trying to render text with Harfbuzz and a signed distance field atlas.</p>
<p>The code is basically this:</p>
<pre class=""lang-cpp prettyprint-override""><code>void drawText(const std::wstring &amp;str, Vec2 pos)
{
    // Init harfbuzz
    hb_buffer_t *hbBuf = hb_buffer_create();
    hb_buffer_set_direction(hbBuf, HB_DIRECTION_LTR);
    hb_buffer_set_script(hbBuf, HB_SCRIPT_LATIN);
    hb_buffer_set_language(hbBuf, hb_language_from_string(&quot;en&quot;, 2));

    // Process string
    hb_buffer_add_utf32(hbBuf, reinterpret_cast&lt;const uint32_t*&gt;(str.c_str()), -1, 0, -1);
    hb_shape(font.hb, hbBuf, nullptr, 0);

    // Display string
    unsigned int nbGlyphs;
    hb_glyph_info_t *glyphInfos = hb_buffer_get_glyph_infos(hbBuf, &amp;nbGlyphs);
    hb_glyph_position_t *glyphPos = hb_buffer_get_glyph_positions(hbBuf, &amp;nbGlyphs);

    for(unsigned int i = 0; i &lt; nbGlyphs; i++)
    {
        Vec2 drawPos = pos + Vec2(glyphPos[i].x_offset, glyphPos[i].y_offset) / 64.f;
        drawGlyph(glyphInfos[i].codepoint, drawPos);
        pos.x += glyphPos[i].x_advance / 64.f;
        pos.y += glyphPos[i].y_advance / 64.f;
    }
}
</code></pre>
<p>The text looks correctly shaped for an English phrase, but when I test it with diacritics, they look misplaced.
I am testing it with <code>aâa aâ̈a bb̂b bb̂̈b bb̧b bb͜b bb︠︡b</code>. The Unicode string does not contain precombined characters. <code>Harfbuzz</code> uses the precombined character <code>â</code>, which makes this one look good. Most other diacritics are off.</p>
<p><a href=""https://i.stack.imgur.com/64hzE.png"" rel=""nofollow noreferrer"">Text with diacritics on the left of where they should be</a></p>
<p>When I multiply <code>x_offset</code> by <code>0.5</code>, the combining characters are better placed. The accents and the cedilla are at the right x position. The accents do not stack and are too low on the <code>b</code>. The arc under <code>BBB</code> (U+035C) should join the two last letters instead of being centered on the 2nd <code>b</code>.</p>
<p>I also tried with U+FE20 and U+FE21 on the previous group of <code>b</code>. In my tests, U+FE21 is on the 2nd <code>b</code>, but it looks like it should be on the 3rd.</p>
<p><a href=""https://i.stack.imgur.com/ZkXmv.png"" rel=""nofollow noreferrer"">Test with <code>glyphPos[i].x_offset * 0.5f</code>, better but still wrong</a></p>
<p>I tried with several fonts, but of those fonts, only NotoSansDisplay-Regular.ttf had combining characters. I did not manage to make a program display that string as expected on my Debian system (testing, with HarfBuzz 2.6.4-1).</p>
<p>With Windows, I got better results. Here is what I expect: the accents are stacked, the combining double breve below it at the right place, the cedilla is off.</p>
<p><a href=""https://i.stack.imgur.com/VzcXa.png"" rel=""nofollow noreferrer"">Text rendering closer to what I expect</a></p>
<p>Am I doing something wrong with HarfBuzz, or I am testing to niche cases that HarfBuzz does support yet?</p>
<p><strong>EDIT:</strong></p>
<p>The actual problem was not described above.
I loaded a font with FreeType <code>FT_New_Face</code> then created a <code>hb_font_t</code> with hb_ft_font_create.
For every string drawn, I called <code>FT_Set_Pixel_Sizes</code> but kept that <code>hb_font_t</code>.</p>
",https://stackoverflow.com/questions/58867804/correct-combining-characters-positions-with-harfbuzz,"['text-rendering', 'harfbuzz']",702,True,3,2
Could not find Turbolinks,"<p>I have used the installer from rubyinstaller.org. But I get this error afterwards</p>

<blockquote>
  <p>Could not find gem <code>'turbolinks (~&gt; 5) x86-mingw32'</code> in any of the gem sources listed in your <code>Gemfile</code>.</p>
</blockquote>

<p>I have tried some of the advices in the threats with a similar error, but no luck. Can someone guide in the right direction?</p>

<p>My gemfile:</p>

<blockquote>
  <p>source '<a href=""https://rubygems.org"" rel=""nofollow noreferrer"">https://rubygems.org</a>'</p>
  
  <p>git_source(:github) do |repo_name|   repo_name =
  ""#{repo_name}/#{repo_name}"" unless repo_name.include?(""/"")<br>
  ""<a href=""https://github.com/#"" rel=""nofollow noreferrer"">https://github.com/#</a>{repo_name}.git"" end</p>
  
  <p># Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.1.3'
  # Use sqlite3 as the database for Active Record gem 'sqlite3', git: ""<a href=""https://github.com/larskanis/sqlite3-ruby"" rel=""nofollow noreferrer"">https://github.com/larskanis/sqlite3-ruby</a>"", branch: ""add-gemspec""
  # Use Puma as the app server gem 'puma', '~> 3.7'
  # Use SCSS for stylesheets gem 'sass-rails', '~> 5.0'
  # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0'
  # See <a href=""https://github.com/rails/execjs#readme"" rel=""nofollow noreferrer"">https://github.com/rails/execjs#readme</a> for more supported \runtimes
  # gem 'therubyracer', platforms: :ruby</p>
  
  <p># Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.2'
  # Turbolinks makes navigating your web application faster. Read more: <a href=""https://github.com/turbolinks/turbolinks"" rel=""nofollow noreferrer"">https://github.com/turbolinks/turbolinks</a> gem 'turbolinks', '~> 5' gem
  'turbolinks-source', '~> 5'
  # Build JSON APIs with ease. Read more: <a href=""https://github.com/rails/jbuilder"" rel=""nofollow noreferrer"">https://github.com/rails/jbuilder</a> gem 'jbuilder', '~> 2.5'
  # Use Redis adapter to run Action Cable in production
  # gem 'redis', '~> 3.0'
  # Use ActiveModel has_secure_password
  # gem 'bcrypt', '~> 3.1.7'</p>
  
  <p># Use Capistrano for deployment
  # gem 'capistrano-rails', group: :development</p>
  
  <p>group :development, :test do   # Call 'byebug' anywhere in the code to
  stop execution and get a debugger console   gem 'byebug', platforms:
  [:mri, :mingw, :x64_mingw]   # Adds support for Capybara system
  testing and selenium driver   gem 'capybara', '~> 2.13'   gem
  'selenium-webdriver' end</p>
  
  <p>group :development do   # Access an IRB console on exception pages or
  by using &lt;%= console %> anywhere in the code.   gem 'web-console', '>=
  3.3.0' end</p>
  
  <p># Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]</p>
</blockquote>
",https://stackoverflow.com/questions/56321290/could-not-find-turbolinks,"['ruby', 'rubygems']",237,False,0,0
