Navigation

    SOFTWARE TESTING

    • Register
    • Login
    • Search
    • Job Openings
    • Freelance Jobs
    • Companies
    • Conferences
    • Courses
    1. Home
    2. Saumya
    S
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Saumya

    @Saumya

    2
    Reputation
    30064
    Posts
    5
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Saumya Follow

    Best posts made by Saumya

    • RE: Validation of regex with indicative (adonisJs)

      If anyone needs it, I could use it. rules as array and using rule():

      const { validate, rule } = use('Validator')
      doc: [rule("regex", /([0-9]{2}[\.]?[0-9]{3}[\.]?[0-9]{3}[\/]?[0-9]{4}[-]?[0-9]{2})|([0-9]{3}[\.]?[0-9]{3}[\.]?[0-9]{3}[-]?[0-9]{2})/g),
            rule("required"),
            rule("min", 11),
            rule("max", 11),
            rule("string")]
      
      posted in Software Programming
      S
      Saumya
    • RE: Why Mockito and Mockmvc don't work together?

      Give it a try with this order.

      Mockito.when(serviceMock.methodname(params)).thenReturn(responseType);
      String json = new Gson().toJson(param);
      MockHttpServletRequestBuilder requestBuilder =
         MockMvcRequestBuilders.post(BASE_ENDPOINT)
             .content(json)
             .contentType(MediaType.APPLICATION_JSON)
             .accept(MediaType.APPLICATION_JSON)
             .characterEncoding(CharEncoding.UTF_8);
      ResultActions resultActions = this.mockMvc.perform(requestBuilder);
      resultActions
         .andExpect(status().isOk())
         .andExpect(
             MockMvcResultMatchers.jsonPath("$.fields").value(param.value())));
      verify(serviceMock, times(1)).method(param);
      
      posted in Automated Testing
      S
      Saumya

    Latest posts made by Saumya

    • How to decrypt Jenkins password?

      In my secrets folder I have these files

      -rw-r--r--  1 root root  272 Oct  2 11:07 hudson.console.AnnotatedLargeText.consoleAnnotator
      -rw-r--r--  1 root root   48 Sep 23 11:40 hudson.console.ConsoleNote.MAC
      -rw-r--r--  1 root root   32 Sep 23 11:42 hudson.model.Job.serverCookie
      -rw-r--r--  1 root root  272 Sep 23 11:39 hudson.util.Secret
      -rw-r--r--  1 root root   32 Sep 23 11:16 jenkins.model.Jenkins.crumbSalt
      -rw-r--r--  1 root root  256 Sep 23 11:16 master.key
      -rw-r--r--  1 root root  272 Sep 23 11:16 org.jenkinsci.main.modules.instance_identity.InstanceIdentity.KEY
      -rw-r--r--  1 root root  272 Sep 23 11:49 org.jenkinsci.plugins.workflow.log.ConsoleAnnotators.consoleAnnotator
      -rw-r--r--  1 root root   48 Sep 23 11:39 org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices.mac
      

      In my case hudson.utils.secrets is binary

      od -h hudson.util.Secret 
      0000000 5f25 eee1 0763 1b49 c074 ee22 af85 4e10
      0000020 00cf dd32 b568 fae3 257a 8d6e 1e56 d995
      

      I installed groovy,I looked at https://devops.stackexchange.com/questions/2191/how-to-decrypt-jenkins-passwords-from-credentials-xml What should I do?

      posted in Continuous Integration and Delivery (CI
      S
      Saumya
    • RE: How to set reserved concurrency of a lambda function

      Functions that don't have reserved concurrency defined need to be able to scale when necessary. AWS insists that you leave 100 invocations for such functions.

      you can use upto Unreserved account concurrency minus 100 when defining reserved concurrency for your functions.

      You can reserve up to the Unreserved account concurrency value that is shown, minus 100 for functions that don't have reserved concurrency. To throttle a function, set the reserved concurrency to zero. This stops any events from being processed until you remove the limit.

      Use GetAccountSettings to see your Regional concurrency limit. You can reserve concurrency for as many functions as you like, as long as you leave at least 100 simultaneous executions unreserved for functions that aren't configured with a per-function limit.

      https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html

      posted in Continuous Integration and Delivery (CI
      S
      Saumya
    • Run docker-in-docker container alongside Jenkins agent

      I'm looking for a way to run a Docker-in-Docker (dind) container alongside my Jenkins agent nodes using the Jenkins Kubernetes Plugin configured by Jenkins Configuration-as-Code (JCasC).

      I'm currently running a plain agent node, that has all my tools installed. Including the Docker client. But no server/daemon running. My idea was now to add another container, that is running the Docker daemon. Both containers share the same working directory, so they operate on the same data.

      Why having it running as two containers? The Docker daemon needs privileged access. And I want to restrict it as much as possible.

      First problem that I encountered was, that Jenkins is not killing the pod when its finished building, but just ends the agent process. Now with another container running, the pod stays alive. I fixed this by writing a file to another shared volume when the agent pod stops, which in turn is read by the dind pod and exits when the file is present.

      Here's an excerpt from my current Pod config:

      apiVersion: "v1"
      kind: "Pod"
      spec:
        serviceAccountName: jenkins-agent
        containers:
        - image: "jenkins-jnlp-image"
          command: [ "/bin/sh", "-c" ]
          args:
          - |
            trap 'touch /usr/share/pod/done' EXIT
            /entrypoint.sh
          name: "jnlp"
          env:
          - name: DOCKER_HOST
            value: tcp://localhost:2375
          securityContext:
            privileged: false
          tty: true
          volumeMounts:
          - mountPath: "/home/jenkins/agent"
            name: "workspace-volume"
            readOnly: false
          - mountPath: /usr/share/pod
            name: tmp-pod
          workingDir: "/home/jenkins/agent"
        - image: "dind-image"
          name: "dind"
          command: [ "/bin/sh", "-c" ]
          args:
            - |
              dockerd-entrypoint.sh &
              while ! test -f /usr/share/pod/done; do
              echo 'Waiting for the jnlp to finish...'
              sleep 5
              done
              echo "Agent pod finished, exiting"
              exit 0
          securityContext:
            privileged: true
          tty: false
          volumeMounts:
          - mountPath: "/home/jenkins/agent"
            name: "workspace-volume"
            readOnly: false
          - mountPath: /usr/share/pod
            name: tmp-pod
          workingDir: "/home/jenkins/agent"
        volumes:
          - emptyDir:
              medium: ""
            name: "workspace-volume"
          - emptyDir: {}
            name: tmp-pod
      

      Is this the deigned way of doing this? Is there any better?

      Bonus question: I install from the https://github.com/jenkinsci/helm-charts/tree/main/charts/jenkins . I could not find a good way to add another container there yet, without overwriting the whole pod template. Does anyone know of a way? If not I would probably create a PR to add that as a feature.

      Thanks in advance!

      posted in Continuous Integration and Delivery (CI
      S
      Saumya
    • AWS- How to estimate a server configuration for nginx load balancer?

      What kind of parameters can be used to estimate how much memory and the number of CPU cores are required for a load balancer?
      I have a requirement to setup LB based on Nginx to route the traffic to other nodes via TCP/IP as on other nodes that have PHP-FPM installed. SSL will terminate at Nginx and traffic to nodes is to be based on just HTTP. Max timeout to be five minutes.

      I am unable to understand how many requests this Nginx LB can swiftly serve while running on a c6gn.medium (1vCPU,2GB Memory, network bandwidth up to 25GBPS) which is CPU optimized and a t4g.medium which is a burstable instance having 2 vCPU and 4GB memory. Cheers!

      posted in Continuous Integration and Delivery (CI
      S
      Saumya
    • Azure Function App logs without Application Insights instance?

      I'm a bit confused about my options for Function App logging on Azure. Is Application Insights the only mechanism available to observe the output logged through the function application's context? In other words, can logs be tailed or log files be temporarily observed anywhere without draining to an instance of Application Insights?

      posted in Continuous Integration and Delivery (CI
      S
      Saumya
    • Does Terraform provide a mechanism to find the provider version?

      Other than reading .terraform.lock.hcl is there a mechanisms in Terraform to find the version of the providers I am using with the cli interface?

      I don't see the version when I run terraform providers or the ability to add a -v flag (or another flag) under terraform providers --help

      posted in Continuous Integration and Delivery (CI
      S
      Saumya
    • TerraForm separate stages

      I want to separate my development stages in the TerraForm repository.

      The TerraForm https://www.terraform.io/language/state/workspaces states:

      "Workspaces alone are not a suitable tool for system decomposition, because each subsystem should have its own separate configuration and backend, and will thus have its own distinct set of workspaces."

      However, many tutorials, like https://learn.hashicorp.com/tutorials/terraform/organize-configuration state:

      "There are two primary methods to separate state between environments: (...) and workspaces."

      Those two statements seem to be in contradiction. Could someone explain what the best practice is for stage separation? Currently I plan to use separate directories:

      ├── prod
      │   ├── main.tf (referencing the modules)
      │   ├── variables.tf
      │   ├── terraform.tfstate
      │   └── terraform.tfvars
      ├── dev
      │   ├── main.tf (referencing the modules)
      │   ├── variables.tf
      │   ├── terraform.tfstate
      │   └── terraform.tfvars
      └── modules
         ├── module A
         └── module B
      
      posted in Continuous Integration and Delivery (CI
      S
      Saumya
    • RE: Kubernetes container networking between pods

      Normally, you access services using the name provided by a Service resource.

      For example, if I have a Pod running Redis, like this:

      apiVersion: v1
      kind: Pod
      metadata:
        labels:
          app: redis
        name: redis
      spec:
        containers:
          - image: docker.io/redis:latest
            name: redis
            ports:
            - containerPort: 6379
              name: redis
      

      I might have a service definition that looks like:

      apiVersion: v1
      kind: Service
      metadata:
        name: redis
      spec:
        selector:
          app: redis
        ports:
        - port: 6379
          targetPort: redis
      

      With these in place, from another Pod I can refer to the Redis service using the hostname redis:

      [root@client /]# redis-cli -h redis
      redis:6379>
      

      The name and port to which we connect is controlled by the Service object. If instead of the above example I had:

      apiVersion: v1
      kind: Service
      metadata:
        name: bob
      spec:
        selector:
          app: redis
        ports:
        - port: 2000
          targetPort: redis
      

      I would need to connect like this:

      [root@client /]# redis-cli -h bob -p 2000
      bob:2000>
      

      For more information:

      • https://kubernetes.io/docs/concepts/services-networking/service/
      posted in Continuous Integration and Delivery (CI
      S
      Saumya
    • RE: Typical build size of the top 20 most popular frameworks?

      Maybe instead of trying to discover the "typical" or "average" size of an app built with a particular framework, since this will be purely anecdotal and difficult to search for, you could instead search for some of the most popular applications with that framework and compare those sizes? As you stated in your question, some of these frameworks tend to be smaller, but depend entirely on the development team behind them.

      Aside from the finding of the supporting information, I would also encourage you to talk about the benefits of having a smaller build, especially if your audience consists of non-dev ops people. Thinks to talk about would be shorter build times, better performance, code readability, fewer dependencies, quicker deployment times, etc. I think by starting your presentation with these kinds of talking points, you are solidifying the need for moving to a different type of framework.

      posted in Continuous Integration and Delivery (CI
      S
      Saumya
    • RE: Is everything, including mods, limited to pixels in Minecraft Java?

      The short answer is that blocks can have whatever textures they want. For reasons of efficiency, vanilla Minecraft limits itself to 16 logical colours for coloured items/blocks, but that is simply a choice, not a technical restriction.

      (Side note: it used to be a technical restriction when coloured blocks were stored as a single block + 4 bits of arbitrary data, but that scheme is gone since 1.13)

      However, if you are adding custom content, then your textures can be whatever colour(s) you want in the 24-bit RGB space. So, for example if you are generating textures dynamically, then you can include gradients or whatever you want with no problem.

      (While not really part of the question, as for implementing the eye dropper tool, it seems like it might be easier to read from the screen buffer than trying to do something like raycasting in the world. But, I'm not sure if that is possible in the Minecraft engine, never tried it myself)

      posted in Game Testing
      S
      Saumya